function onStepIn(cid, item, frompos, item2, topos)
local direction = {0=2,1=3,2=0,3=1}
local text = "You have successfully passed the Level ".. (item.actionid - 1000) .." Bridge."
local Text = "You May not pass the Level ".. (item.actionid - 1000) .." Bridge."
if item.actionid == item.actionid then
if getPlayerLevel(cid) >= (item.actionid - 1000) then
doPlayerSendTextMessage(cid,22,text)
else
newdir = getPlayerLookDir(cid)
doMoveCreature(cid,direction[newdir])
doPlayerSendTextMessage(cid,22,Text)
end
end
return TRUE
end
<movevent event="StepIn" itemid="xxxx" script="levelbridge.lua" />
function onStepIn(cid, item, frompos, item2, topos)
local text = "You have successfully passed the Level ".. (item.actionid - 1000) .." Bridge."
local Text = "You May not pass the Level ".. (item.actionid - 1000) .." Bridge."
if item.actionid == item.actionid then
if getPlayerLevel(cid) < (item.actionid - 1000) then
if getPlayerLookDir(cid) < 2 then
doMoveCreature(cid,(getPlayerLookDir(cid) + 2))
doPlayerSendTextMessage(cid,22,Text)
elseif getPlayerLookDir(cid) >= 2 then
doMoveCreature(cid,(getPlayerLookDir(cid) - 2))
doPlayerSendTextMessage(cid,22,Text)
end
else
doPlayerSendTextMessage(cid,text)
end
end
return TRUE
end