function onUse(cid, item, frompos, item2, topos)
local storage = xxxx -- This number you will imput into map editor for the door you wish
area = {x=995, y=993, z=7}
queststatus = getPlayerStorageValue(cid,storage)
if item.uid == storage then
if queststatus == -1 then
doCreatureSay(cid, "Text when cannot enter :D:D ", TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, area,0)
doSendMagicEffect(topos, 12)
doCreatureSay(cid, "Text if can enter:D", TALKTYPE_ORANGE_1)
end
end
return 1
end
<action uniqueid="xxxx" script="VIP Door.lua"/>
function onUse(cid, item, frompos, item2, topos)
local storage = xxxx -- This number you will imput into map editor for the door you wish
area = {x=frompos.x, y=frompos.y+1, z=.frompos.z}
queststatus = getPlayerStorageValue(cid,storage)
if queststatus == -1 then
doCreatureSay(cid, "Text when cannot enter :D:D ", TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, area,0)
doSendMagicEffect(topos, 12)
doCreatureSay(cid, "Text if can enter:D", TALKTYPE_ORANGE_1)
end
return 1
end
area = {x=frompos.x, y=frompos.y+1, z=.frompos.z}
I'm sorry but I don't want the player to be teleported...
I just want him to be able to open the door(the red nob one)
local storage = 1234
local doorPos = {x = 1234, y = 1234, z = 7} -- The position of the door
local door_open = 1234 -- Id of the door OPEN!
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,storage) ~= 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This door seems to be sealed against unwanted intruders.")
else
doTeleportThing(cid, doorPos, FALSE)
doTransformItem(item.uid, door_open)
end
return true
end