• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Teleport Player position

szymon095

New Member
Joined
May 16, 2009
Messages
22
Reaction score
2
Hello, someone help me convert this script to click on the item with the ActionID teleports us into a random positions?

local positions = {
{x = 93, y = 139, z = 7},
{x = 92, y = 139, z = 7},
{x = 94, y = 139, z = 7},

}


function onStepIn(cid, item, position, fromPosition)
local randPos = positions[math.random(1, #positions)]
doTeleportThing(cid, randPos)
doSendMagicEffect(randPos, CONST_ME_TELEPORT)

return true
end
 
Lua:
function onUse(cid, item, frompos, item2, topos)

local positions = 
{{x=93, y=139, z=7}, 
{x=92, y=139, z=7}, 
{x=94, y=139, z=7}}

local rand = math.random(1, #pos)
doTeleportThing(cid, pos[rand])
doSendMagicEffect(10, pos[rand])

end

Lua:
<action itemid="...." script="rand_?.lua"/>
 
Back
Top