ond
Veteran OT User
I need help with my quest door script! Is it possible to make it reversed
(getPlayerStorageValue(cid, item.actionid) == -1)
by using actionid 3001-3999? Here is my example:
Something like that! Post if you didn't understand my thinking.
(getPlayerStorageValue(cid, item.actionid) == -1)
by using actionid 3001-3999? Here is my example:
LUA:
function onUse(cid, item, frompos, item2, topos)
if(item.actionid == 0) then
-- Make it a normal door
doTransformItem(item.uid, item.itemid+1)
return TRUE
end
local canEnter = (getPlayerStorageValue(cid, item.actionid) == 1)
if not(canEnter) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door is sealed against unwanted intruders.")
return TRUE
end
doTransformItem(item.uid, item.itemid+1)
local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
if not(canGo) then
return FALSE
end
local dir = getDirectionTo(getPlayerPosition(cid), frompos)
doMoveCreature(cid, dir)
return TRUE
end
elseif(item.actionid >= 3001 and item.actionid <= 3999)then
local canEnter = (getPlayerStorageValue(cid, item.actionid) == -1)
if not(canEnter) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door is sealed against unwanted intruders.")
return TRUE
end
doTransformItem(item.uid, item.itemid+1)
local canGo = (queryTileAddThing(cid, frompos, bit.bor(2, 4)) == RETURNVALUE_NOERROR) --Veryfies if the player can go, ignoring blocking things
if not(canGo) then
return FALSE
end
local dir = getDirectionTo(getPlayerPosition(cid), frompos)
doMoveCreature(cid, dir)
return TRUE
end
Something like that! Post if you didn't understand my thinking.