nevix
Tunzodus.net
When normal player click on item nothing happinned:
When GM preesed on item:
Here my script:
Please help

When GM preesed on item:

Here my script:
Code:
local t = {
sec = 10,
sec2 = 5,
portal = {x = 32346, y = 32224, z = 7},
itemid = 11796,
active = 1,
cooldown = 10,
storage = 15004
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local infostorage = getPlayerStorageValue(cid, 15000)
if getPlayerStorageValue(cid, t.storage) >= os.time() then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wait ".. getPlayerStorageValue(cid, t.storage) - os.time().." Sec. Until you can use again.")
else
setPlayerStorageValue(cid, t.storage, os.time() + t.cooldown)
if (infostorage == 1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Portal has been opened for 10 seconds.")
local portalwhere = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z}
local portal = doCreateItem(t.itemid,1,portalwhere)
doSetItemActionId(portal, 20001)
addEvent(function()
doRemoveItem(getTileItemById(portalwhere, t.itemid).uid)
end,
t.sec * 1000)
end
if (infostorage == 0) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Portal has been opened for 10 seconds.")
local portalwhere = {x = getCreaturePosition(cid).x, y = getCreaturePosition(cid).y-1, z = getCreaturePosition(cid).z}
local portal = doCreateItem(t.itemid,1,portalwhere)
doSetItemActionId(portal, 20001)
addEvent(function()
doRemoveItem(getTileItemById(portalwhere, t.itemid).uid)
end,
t.sec * 1000)
end
end
return true
end
Please help
