local t = {
sec = 10,
sec2 = 5,
portal = {x = 32353, y = 32219, z = 7},
portalwhere = {x = 32341, y = 32226, z = 7},
itemid = 11798,
active = 1,
cooldown = 10,
storage = 11999,
storage2 = 11998
}
function onStepIn(cid, item, position, lastPosition)
local viptimestorage = 15001
local player = Player(cid)
if (player:getStorageValue(viptimestorage) <= os.time()) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have VIP priviliges. You can buy VIP doll from website.")
elseif getGlobalStorageValue(t.storage2) >= os.time() then
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wait ".. getGlobalStorageValue(t.storage2) - os.time().." Sec. Until you can walk again.")
else
local portal = doCreateItem(t.itemid,1,t.portalwhere)
doSetItemActionId(portal, 12001)
addEvent(function() doRemoveItem(getTileItemById(t.portalwhere, t.itemid).uid) end,t.cooldown * 1000)
doSendMagicEffect(t.portalwhere, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Teleport created for 10 seconds.")
setGlobalStorageValue(t.storage2, os.time() + t.cooldown)
end
return true
end
may you explain it please because i can't understand some things on it, and for sure i will work hard to learnIts your start what you want to do.. Take it and be happy, use it and move your brains, nobody gonna do everything for you
Code:local t = { sec = 10, sec2 = 5, portal = {x = 32353, y = 32219, z = 7}, portalwhere = {x = 32341, y = 32226, z = 7}, itemid = 11798, active = 1, cooldown = 10, storage = 11999, storage2 = 11998 } function onStepIn(cid, item, position, lastPosition) local viptimestorage = 15001 local player = Player(cid) if (player:getStorageValue(viptimestorage) <= os.time()) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have VIP priviliges. You can buy VIP doll from website.") elseif getGlobalStorageValue(t.storage2) >= os.time() then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wait ".. getGlobalStorageValue(t.storage2) - os.time().." Sec. Until you can walk again.") else local portal = doCreateItem(t.itemid,1,t.portalwhere) doSetItemActionId(portal, 12001) addEvent(function() doRemoveItem(getTileItemById(t.portalwhere, t.itemid).uid) end,t.cooldown * 1000) doSendMagicEffect(t.portalwhere, CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Teleport created for 10 seconds.") setGlobalStorageValue(t.storage2, os.time() + t.cooldown) end return true end
Cryingdamson 0.3.6What server version do you want this for?