local pos= {x=1000,y=1000,z=7} -- where tp will teleport player
local storage = 3000 -- need storage need to be same as the one in talkaaction
function onStepIn(cid, item, position, fromPosition)
if getPlayerStorageValue(cid,storage) == 2 then
doTeleportThing(cid,pos)
doSendMagicEffect(getCreaturePosition(cid), 10)
return true
end
if getPlayerStorageValue(cid,storage) == 3 then
doTeleportThing(cid, fromPosition, TRUE)
doCreatureSay(cid,"The pass you entered is wrong.",TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 2)
return true
end
if getPlayerStorageValue(cid,storage) == 1 then
doTeleportThing(cid, fromPosition, TRUE)
doCreatureSay(cid,"You have to type <!pass (type password)> then click enter to pass.",TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 2)
return true
end
doCreatureSay(cid,"Please type <!pass (type password)> then click enter.",TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,storage,1)
doTeleportThing(cid, fromPosition, TRUE)
return true
end
function onStepOut(cid, item, position, fromPosition)
if getPlayerStorageValue(cid,storage) == 2 then
setPlayerStorageValue(cid,storage,-1)
return true
end
end