Forum General
1st Donator Division
Sorry for posting too many help threads.
I tried making it myself first, but then it just blows me off when it doesn't work.
This time; the script is supposed to randomize everyone's temple position everytime they log in.
Here's what I have:
I have 2 positions set because I just wanted to test and make sure it works.
Here's the error:
I tried making it myself first, but then it just blows me off when it doesn't work.
This time; the script is supposed to randomize everyone's temple position everytime they log in.
Here's what I have:
Code:
local TEMPLE = {{{ x = 247, y = 251, z =7 }}, { x = 258, y = 245, z =7 }}
function onLogin(cid)
local random = math.random(1, table.maxn(TEMPLE))
if isPlayer(cid) == TRUE then
doTeleportThing(cid, random)
end
return true
end
I have 2 positions set because I just wanted to test and make sure it works.
Here's the error:
[07/05/2010 21:23:28] [Error - CreatureScript Interface]
[07/05/2010 21:23:28] data/creaturescripts/scripts/randomtemple.luanLogin
[07/05/2010 21:23:28] Description:
[07/05/2010 21:23:28] attempt to index a number value
[07/05/2010 21:23:28] stack traceback:
[07/05/2010 21:23:28] [C]: in function 'doTeleportThing'
[07/05/2010 21:23:28] data/creaturescripts/scripts/randomtemple.lua:6: in function <data/creaturescripts/scripts/randomtemple.lua:3>