Postado Fevereiro 1, 2019 6 anos Olá Reescrevi o código para TFS 1.3 com itens aleatórios. Obs: só recebe 1 item (quantidade), mesmo os agrupáveis. local config = { level = 99, items = { 11258, -- phoenix charm 11259, -- unity charm 11260, -- spiritual charm 11261, -- twin charm 11262, -- solitude charm 2160, -- crystal coin 2195 -- boots of haste }, tempo = 24*3600, -- horas storage = 31402 } function onUse(player, item, fromPosition, itemEx, toPosition) local player = Player(player) if not player then return end if player:getLevel() < config.level then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be level 100 or higher.") return end if player:getStorageValue(config.storage) - os.time() > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait 24 hours before getting new daily reward.") return end player:setStorageValue(config.storage, os.time() + config.tempo) player:addItem(config.items[math.random(1, #config.items)]) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received a random item.") return true end
Postado Agosto 6, 2021 3 anos Em 23/07/2018 em 11:34, tataboy67 disse: Opa galera beleza? Eu vi um cidadão aqui do forum pedindo, e para não reviver o tópico resolvi desenvolver 1 e postar @ADM Mayk on BaiakME Ta ai o script que tu pediu. Crie um arquivo com o nome de Bau_Diario.lua local config = { items = { [1] = {2160, 10}, [2] = {2159, 10} }, level = 100, 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 Adicione a TAG em actions.xml <action actionid="22164" script="Bau_Diario.lua"/> Créditos: Eu maaano vc nao teria esse script pra um servidor em " revscript ? " meu tfs e 1.4 qeria fazer isso ai Em 01/02/2019 em 00:51, luiz.marsilio disse: Olá Reescrevi o código para TFS 1.3 com itens aleatórios. Obs: só recebe 1 item (quantidade), mesmo os agrupáveis. local config = { level = 99, items = { 11258, -- phoenix charm 11259, -- unity charm 11260, -- spiritual charm 11261, -- twin charm 11262, -- solitude charm 2160, -- crystal coin 2195 -- boots of haste }, tempo = 24*3600, -- horas storage = 31402 } function onUse(player, item, fromPosition, itemEx, toPosition) local player = Player(player) if not player then return end if player:getLevel() < config.level then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be level 100 or higher.") return end if player:getStorageValue(config.storage) - os.time() > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait 24 hours before getting new daily reward.") return end player:setStorageValue(config.storage, os.time() + config.tempo) player:addItem(config.items[math.random(1, #config.items)]) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received a random item.") return true end consegue fazer um desse pra revscript ? e outra onde eu sei qual a action id q voupor no bau pra poder pegar isso ?
Postado Novembro 1, 2021 3 anos Em 23/07/2018 em 11:34, tataboy67 disse: Opa galera beleza? Eu vi um cidadão aqui do forum pedindo, e para não reviver o tópico resolvi desenvolver 1 e postar @ADM Mayk on BaiakME Ta ai o script que tu pediu. Crie um arquivo com o nome de Bau_Diario.lua local config = { items = { [1] = {2160, 10}, [2] = {2159, 10} }, level = 100, 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 Adicione a TAG em actions.xml <action actionid="22164" script="Bau_Diario.lua"/> Créditos: Eu Esse código é adaptado para 1.2 tfs 1098 ?
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.