Hi i have a script that if you have the item you may enter the Spawn for 30 minute, its a teleport.
But it doesn't really work
Its not that i don't enter, i do. But i can stay there as long as i like.
But it doesn't really work
LUA:
local aid_of_door = 1790 -- ActionID of all VIP Doors.
local ITEMID_OF_VIPTOKEN = 2157
local COUNT_OF_ITEM = 1
-- 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+1800) <= 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 half an hour access to this spawn.")
if(not doorEnter(cid, item, toPosition)) then return false end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need atleast 1 VIP Nugget 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
Its not that i don't enter, i do. But i can stay there as long as i like.
Last edited: