Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local aid_of_door = 1790 -- ActionID of all VIP Doors.
- local ITEMID_OF_VIPTOKEN = 6527
- local COUNT_OF_ITEM = 100
- -- DO NOT EDIT BELOW THIS LINE
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if(item.actionid == aid_of_door) then
- local stor = getPlayerStorageValue(cid, item.uid)
- if(stor < 1 or (stor+3600) <= os.time()) then
- local ret = doPlayerRemoveItem(cid, ITEMID_OF_VIPTOKEN, COUNT_OF_ITEM)
- if(ret) then
- setPlayerStorageValue(cid, item.uid, os.time())
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You now have one hour access to this spawn.")
- if(not doorEnter(cid, item, toPosition)) then return false end
- else
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need atleast 100 GAME TOKENS to enter this spawn.")
- end
- else
- if(not doorEnter(cid, item, toPosition)) then return false end
- end
- end
- return true
- end
- function doorEnter(cid, item, toPosition)
- local mob = getTopCreature(toPosition); if(mob.uid > 0) then return false end
- doTransformItem(item.uid, item.itemid + 1)
- doTeleportThing(cid, toPosition)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement