function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,[COLOR="Red"]number[/COLOR]) == 1 then
doCreatureSay(cid, "Wellcome Vip", TALKTYPE_ORANGE_2)
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,21,'Only VIP Player Can Pass This Door.')
end
return 1
end
<action uniqueid="[COLOR="Red"]number[/COLOR]" script="vipdoor.lua" />
function onUse(cid, item, frompos, item2, topos)
local config = {
oldpos = {x=32368, y=32221, z=7}
newpos = {x=32303, y=31562, z=7}
storage = 1500
}
if item.uid == 1000 and getPlayerStorageValue(cid,config.storage) == 1 and getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
doTeleportThing(cid, config.newpos)
doSendMagicEffect(config.newpos, 12)
else
doPlayerSendCancel(cid, "You have to have VIP to use this door.")
doTeleportThing(cid, config.oldpos)
doSendMagicEffect(config.oldpos, 53)
end
return TRUE
end