TFS/Data/Movevents/scripts/tp.lua
local n = {position = {x = 1000, y = 1000, z = 7}, effect = 10}
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
doPlayerRemoveItem(cid, 1234, 1)
doTeleportThing(cid, n.position, true)
doSendMagicEffect(n.position, n.effect)
else
doPlayerSendCancel(cid, "You need to have item.")
end
return true
end
<movevent event="StepIn" actionid="59906" script="tp.lua" />
local c = {
tpt = {x = 1000, y = 1000, z = 7}, -- position where tp tp player
tpItem = 00000 -- here item id numer
}
function onStepIn(cid, item, position, fromPosition)
if(not isPlayer(cid) then return false end
if doPlayerRemoveItem(cid, tpItem, 1) then
doTeleportThing(cid, c.tpt, false)
doSendMagicEffect(c.tpt, CONST_ME_TELEPORT)
else
addEvent(doTeleportThing, 1, cid, fromPosition)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have...")
end
return true
end
<movevent event="StepIn" actionid="YOUR ACTION ID NR" script="tp.lua" />
LUA:local c = { tpt = {x = 1000, y = 1000, z = 7}, -- position where tp tp player tpItem = 00000 -- here item id numer } function onStepIn(cid, item, position, fromPosition) if(not isPlayer(cid) then return false end if doPlayerRemoveItem(cid, tpItem, 1) then doTeleportThing(cid, c.tpt, false) doSendMagicEffect(c.tpt, CONST_ME_TELEPORT) else addEvent(doTeleportThing, 1, cid, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have...") end return true end
XML:<movevent event="StepIn" actionid="YOUR ACTION ID NR" script="tp.lua" />
local c = {
tpt = {x=861, y=93, z=8}, -- position where tp tp player
tpItem = 2491 -- here item id numer
}
function onStepIn(cid, item, position, fromPosition)
if(not isPlayer(cid)) then return false end
if doPlayerRemoveItem(cid, c.tpItem, 1) then
doTeleportThing(cid, c.tpt, false)
doSendMagicEffect(c.tpt, CONST_ME_TELEPORT)
else
addEvent(doTeleportThing, 1, cid, fromPosition)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have...")
end
return true
end
plx?and you can make for me?![]()
sorry, typo.. here:
testedLUA:local c = { tpt = {x=861, y=93, z=8}, -- position where tp tp player tpItem = 2491 -- here item id numer } function onStepIn(cid, item, position, fromPosition) if(not isPlayer(cid)) then return false end if doPlayerRemoveItem(cid, c.tpItem, 1) then doTeleportThing(cid, c.tpt, false) doSendMagicEffect(c.tpt, CONST_ME_TELEPORT) else addEvent(doTeleportThing, 1, cid, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have...") end return true end
local c = {
{x=1111, y=1111, z=11},
{x=1111, y=1111, z=11},
{x=1111, y=1111, z=11},
{x=1111, y=1111, z=11},
{x=1111, y=1111, z=11}
}
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then return true end
for i = 1, 4 in ipairs(c) do
local czaha = getThingFromPos(i)
if czaha.itemid ~= YOURITEMID then
return doPlayerSendCancel(cid, "All items must be on the correct positions.")
end
end
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
doTeleportThing(cid, c[5])
doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)
return true
end
@up
actionid you gave on the map? and in action.xml?
<movevent event="StepIn" actionid="59906" script="tptp.lua" />
local c = {
tpt = {x=1746, y=1855, z=7}, -- position where tp tp player
tpItem = xxxxx -- here item id numer
}
function onStepIn(cid, item, position, fromPosition)
if(not isPlayer(cid)) then return false end
if doPlayerRemoveItem(cid, c.tpItem, 1) then
doTeleportThing(cid, c.tpt, false)
doSendMagicEffect(c.tpt, CONST_ME_TELEPORT)
else
addEvent(doTeleportThing, 1, cid, fromPosition)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have bla, blah, blah")
end
return true
end
tpItem = xxxxx -- here item id numer