Hi i need sript that will be move a player from temple position to random sqm next to temple posiotion.. Player can not stand at this sqm becouse this script should move him to another sqm automaticaly.
I have this script but doesnt work good.
any ideas?
I have this script but doesnt work good.
Code:
data\creaturescripts creaturescripts.xml add:
<event type="login" name="PlayerLogin" event="script" value="ranpos.lua"/>
data\creaturescripts\scripts make: ranpos.lua and add:
function onLogin(cid)
local pos = getTownTemplePosition(cid)
local config = {
position = {{x=pos.x-1, y=pos.y, z=pos.z}, {x=pos.x, y=pos.y-1, z=pos.z}, {x=pos.x+1, y=pos.y-1, z=pos.z}},
number = math.random(1, 3)
}
doTeleportThing(cid, config.position[config.number])
return true
end
any ideas?