ssiwyy158
Member
- Joined
- Jan 24, 2011
- Messages
- 128
- Solutions
- 2
- Reaction score
- 13
Hello. How to write a script checking the duration of the xp bonus from this script ? :
tfs 1.2
tfs 1.2
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(98546) >= os.time() then
player:say('You already have exp bonus!', TALKTYPE_MONSTER_SAY)
return true
end
player:setStorageValue(98546, os.time() + 3600)
Item(item.uid):remove(1)
player:say('Your 1 hours of 20% XP has started!', TALKTYPE_MONSTER_SAY)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
return true
end