Got A problem with my FunScript...
I want to add a RightClicker to it, so i thought i had the code in a sepperate file... so i use this in the main file...
assert(dofile("FunScript/zFunRightClick.lua"),"Error!")
And this in the rightclcik....
--curUser:SendData("$UserCommand 1 2 FunScript\\Do To A User\\Command$<%[mynick]> !command %[nick]||")
curUser:SendData("$UserCommand 1 2 FunScript\\Do To A User\\Slap User$<%[mynick]> !slap %[nick]||")
curUser:SendData("$UserCommand 1 2 FunScript\\Do To A User\\Love User$<%[mynick]> !love %[nick]||")
But I Get this error....
Syntax error: attempt to index global `curUser' (a nil value)
stack traceback:
1: main of file `FunScript/zFunRightClick.lua' at line 2
2: function `dofile' [C]
3: main of file `...ram\Hub\PtokaX-0.330 madhouse\scripts\Funv5.lua' at line 142
Syntax error: assertion failed! Error!
stack traceback:
1: function `assert' [C]
2: main of file `...ram\Hub\PtokaX-0.330 madhouse\scripts\Funv5.lua' at line 142
And, yes i use curUser in the main file...
What do i have to do to get it to work?
put this into the file you wanna call the dofile on:
function sendusercommands(curUser)
curUser:SendData(blahblah) -- sending usercmds here
end
this is because curUser is local to the NewUserConnected, not global.
Thanks =)