Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
I am attempting to use a teleport lever to teleport a player from the "fromPos" on that specific tile. the lever works without standing on the pos. what am I missing? cryingdamson 0.3.6 (8.60) is the distro.
Code:
local function reset(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local toPos = {x=1059, y=911, z=6}
local fromPos = {x=1057, y=917, z=6}
if getPlayerLevel(cid) >=80 then
if item.itemid == 1945 then
doTeleportThing(cid, toPos, true)
doPlayerSendTextMessage(cid, 22, "Phrase goes here!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doTransformItem(item.uid, item.itemid + 1)
addEvent(reset, 10 * 1000, toPosition) --Timer
elseif item.itemid == 1946 then
doPlayerSendTextMessage(cid, 22, "Wait for switch to reset.")
end
else
stopEvent(event)
reset(toPosition)
doPlayerSendCancel(cid, "You don't have the required level.")
end
return TRUE
end
Last edited: