Postado Agosto 28, 2020 4 anos Galera, tenho um sv 8.60 queria pedir ajuda de vcs em um script até interessante, que enche stamina enquanto treina... Eu estou procurando por ela a mtooo tempo para TFS 1.3 por favor se alguem tiver ow quiser criar por favor, seria de grande ajudar!!!!
Postado Agosto 28, 2020 4 anos 1 hora atrás, yuriowns disse: Galera, tenho um sv 8.60 queria pedir ajuda de vcs em um script até interessante, que enche stamina enquanto treina... Eu estou procurando por ela a mtooo tempo para TFS 1.3 por favor se alguem tiver ow quiser criar por favor, seria de grande ajudar!!!! tente com este, e lembre-se de registrar o id da ação no remere data/movements/movemnts.xml edite <movevent event="StepIn" actionid="25000" script="others/stamina_tile.lua" /> <movevent event="StepOut" actionid="25000" script="others/stamina_tile.lua" /> data/movements/scripts/sistema_tile.lua Code LUA staminaEvents = {} local config = { timeToAdd = 5, addTime = 1, } local function addStamina(cid) local player = Player(cid) if not player then stopEvent(staminaEvents[cid]) staminaEvents[cid] = nil return true end player:setStamina(player:getStamina() + config.addTime) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You received "..config.addTime.." minutes of stamina.") staminaEvents[cid] = addEvent(addStamina, config.timeToAdd * 60 * 1000, cid) end function onStepIn(creature) if creature:isPlayer() then creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You will receive "..config.addTime.." minute of stamina every "..config.timeToAdd.." minutes.") staminaEvents[creature:getId()] = addEvent(addStamina, config.timeToAdd * 60 * 1000, creature:getId()) end return true end function onStepOut(creature) if creature:isPlayer() then stopEvent(staminaEvents[creature:getId()]) staminaEvents[creature:getId()] = nil end return true end Editado Agosto 28, 2020 4 anos por Mask Ghoul (veja o histórico de edições)
Postado Agosto 29, 2020 4 anos Eu uso desta forma ... em events/scripts/creature.lua: Add a função: -- Regen Stamina in Trainer local staminaBonus = { period = 180000, -- Period in milliseconds bonus = 1, -- gain stamina events = {} } local function addStamina(name) local player = Player(name) if not player then staminaBonus.events[name] = nil else local target = player:getTarget() if not target or target:getName() ~= "Trainer" then staminaBonus.events[name] = nil else player:setStamina(player:getStamina() + staminaBonus.bonus) staminaBonus.events[name] = addEvent(addStamina, staminaBonus.period, name) end end end E dentro da função Creature:onTargetCombat(target) colocar essa parte: -- Regen Stamina in Trainer if self:isPlayer() then if target and target:getName() == "Trainer" then local name = self:getName() if not staminaBonus.events[name] then staminaBonus.events[name] = addEvent(addStamina, staminaBonus.period, name) end end end STYLLER OT 2022
Postado Agosto 29, 2020 4 anos https://otland.net/threads/tfs-1-2-trainer-stamina-regen.250746/ Discord: Naze#3578 Ter Linux Dentro de Windows com Acesso 'localhost' para testes e + AutoLoot Otimizado Direto na Source (tfs 0.4/otx) // Pirataria é crime, original é roubo, compartilhar é legal.
Postado Setembro 1, 2020 4 anos Autor Em 28/08/2020 em 21:36, luanluciano93 disse: Eu uso desta forma ... em events/scripts/creature.lua: Add a função: -- Regen Stamina in Trainer local staminaBonus = { period = 180000, -- Period in milliseconds bonus = 1, -- gain stamina events = {} } local function addStamina(name) local player = Player(name) if not player then staminaBonus.events[name] = nil else local target = player:getTarget() if not target or target:getName() ~= "Trainer" then staminaBonus.events[name] = nil else player:setStamina(player:getStamina() + staminaBonus.bonus) staminaBonus.events[name] = addEvent(addStamina, staminaBonus.period, name) end end end E dentro da função Creature:onTargetCombat(target) colocar essa parte: -- Regen Stamina in Trainer if self:isPlayer() then if target and target:getName() == "Trainer" then local name = self:getName() if not staminaBonus.events[name] then staminaBonus.events[name] = addEvent(addStamina, staminaBonus.period, name) end end end obrigado, funcionou!!! REP+
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.