V 10.99 tfs 1.x
Hello,
Already I have this script:
I would like to change the possibility of obtaining for each object. (chance)
I would also like to add, that you can use the reward chest again after 10 hours.
Is it possible?
+rep
Hello,
Already I have this script:
Lua:
local rewards = {
{ item = 9019, count = 1 },
{ item = 5809, count = 1 },
{ item = 8982, count = 1 }
}
local YOUR_STORAGE_NUMBER = 5000
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
if player:getStorageValue(YOUR_STORAGE_NUMBER) ~= 1 then
local random = math.random(1, #rewards)
player:addItem(rewards[random].item, rewards[random].count)
player:sendTextMessage(36, 'You have found '.. ItemType(rewards[random].item):getName() ..'.')
player:setStorageValue(YOUR_STORAGE_NUMBER, 1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already opened this chest.")
end
return true
end
I would like to change the possibility of obtaining for each object. (chance)
I would also like to add, that you can use the reward chest again after 10 hours.
Is it possible?
+rep