Forkz
Well-Known Member
- Joined
- Jun 29, 2020
- Messages
- 380
- Solutions
- 1
- Reaction score
- 89
Hi otlanders,
I was trying to add battle and protection to use the item and I'm not getting it to work.
protect = false = if the player is in PZ area he can use the item.
battle = true = If the player is out of PZ he will have to be without battle to use the item
I was trying to add battle and protection to use the item and I'm not getting it to work.
protect = false = if the player is in PZ area he can use the item.
battle = true = If the player is out of PZ he will have to be without battle to use the item
Lua:
function onUse(cid, item, frompos, item2, topos)
local config = {
removeItem = false,
storage = 10000,
exhaustedtime = 5
}
local pos = getTownTemplePosition(getPlayerTown(cid))
local playerPos = getCreaturePosition(cid)
local levelplayer = 8
if (os.time() < getPlayerStorageValue(cid, config.storage)) then
doPlayerSendTextMessage(cid, 26, "Você deve aguardar " .. getPlayerStorageValue(cid, config.storage) - os.time() .. " segundos para usar o golden falcon.")
return true
end
if config.removeItem then
doRemoveItem(item.uid)
end
doPlayerSendTextMessage(cid, 25, "Você chegou usando o Golden Falcon.")
doSendMagicEffect(playerPos, CONST_ME_POFF)
doTeleportThing(cid, pos)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, config.storage, os.time() + config.exhaustedtime)
return true
end