local config = {
d = 1500 -- unique id of item (teleport)
teleportId = 1387, -- set teleport id self
{{ { x = 581, y = 577, z = 9 }, { x = 581, y = 575, z = 10 },{ x = 581, y = 575, z = 10 }}}, -- self set positions :P
}
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
if item.uniqueid == config.d then
doCreateTeleport(config.teleportId,math.random pos[1], pos[2], pos[3])
end
return TRUE
end
local config = {
pos = { -- positions, feel free to add a new one, or change either.
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7}
},
teleportId = 1387 -- ID of portal.
}
function onStepIn(cid, item, fromPosition, itemEx, toPosition) -- Do not edit below from hear.
doCreateTeleport(config.teleportId, math.random(config.pos[1], config.pos[#config.pos]))
end
Sorry to be a noob but where to put this?
Whont it make it to every teleport?
No uncueid?
local config = {
pos = { -- positions, feel free to add a new one, or change either.
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7}
},
teleportId = 1387 -- ID of portal.
}
function onStepIn(cid, item, fromPosition, itemEx, toPosition) -- Do not edit below from hear.
doCreateTeleport(config.teleportId, math.random(config.pos[1], config.pos[#config.pos]))
end
<movevent type="StepIn" actionid="xxxx" event="script" value="teleport.lua"/>
local config = {
pos = { -- positions, feel free to add a new one, or change either.
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7}
},
teleportId = 1387 -- ID of portal.
}
function onStepIn(cid, item, fromPosition, itemEx, toPosition) -- Do not edit below from hear.
doTeleportThing(cid, math.random(config.pos[1], config.pos[#config.pos]))
end
Lua:local config = { pos = { -- positions, feel free to add a new one, or change either. {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7} }, teleportId = 1387 -- ID of portal. } function onStepIn(cid, item, fromPosition, itemEx, toPosition) -- Do not edit below from hear. doTeleportThing(cid, math.random(config.pos[1], config.pos[#config.pos])) end
Fixed. I hadn't read your post correctly, and now it would do what you want it to do. (Sorry, I had only read the other guy's post)
@UP
Use actionids~
local config = {
pos = {
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7},
{x=1000, y=1000, z=7}
},
teleportId = 1387
}
function onStepIn(cid, item, position, fromPosition)
doTeleportThing(cid, config.pos[math.random(#config.pos)])
end
Whoop dee doo!Code:local config = { pos = { {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7}, {x=1000, y=1000, z=7} }, teleportId = 1387 } function onStepIn(cid, item, position, fromPosition) doTeleportThing(cid, config.pos[math.random(#config.pos)]) end