How can i make a script to prevent player to get up on stairs?
i made this script but the player is not going down
i made this script but the player is not going down
Lua:
function onStepIn(cid, item, pos)
local pos = getCreaturePosition(cid)
local newpos = pos
local direction = getPlayerLookDir(cid)
if getPlayerGUID(cid) >= 1 then
if getPlayerStorageValue(cid, 50002) <= 8 then
newpos = {x=pos.x+2, y=pos.y, z=pos.z+1}
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "This is Telas's room. Maybe you should talk to him before sniffing around in his house.")
doTeleportThing(cid, newpos, true)
elseif getPlayerStorageValue(cid, 50002) >= 11 then
newpos = {x=pos.x+2, y=pos.y, z=pos.z-1}
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have no business here anymore, talk with Tela to remember what you have to do.")
doTeleportThing(cid, newpos, true)
end
else
return FALSE
end
return TRUE
end