VagosClubTM
Active Member
hello friends I have this script that I wish it could work in TFS 1.4, with revscript. I tried but I could not adapt it if someone could help me it would be great I will leave the base code here thank you very much in advance.
Lua:
local config = {
items = {
[1] = {2160, 1},
[2] = {18337, 10},
[3] = {9971, 5}
},
level = 8,
tempo = 24*60*60, -- 24 horas
stoTime = 31402
}
function onUse(player, item, fromPosition, itemEx, toPosition)
if player:getLevel() >= config.level then
if player:getStorageValue(config.stoTime) - os.time() < 0 then
player:setStorageValue(config.stoTime, os.time() + config.tempo)
for _, table in pairs(config.items) do
for i=1, #config.items do
player:addItem(table[i])
end
end
else
player:getStorageValue(config.stoTime, 0)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Wait: %s.", string.diff(player:getStorageValue(config.stoTime)-os.time())))
end
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce nao tem level "..config.level..".")
end
end