local min , max = 1, 25 -- Recuperação de mana entre 1 e 25
local sta = 1 -- Recuperação de 1 minuto de stamina
local t = 5 -- Tempo em segundos da recuperação fica se repetindo
local event = {}
function Player.autoRege(self)
local player = Player(self)
local pid = player:getGuid()
if player:isPlayer() then
if player:getStamina() < 2400 then
player:setStamina(player:getStamina() + sta)
end
if player:getMana() ~= player:getMaxMana() then
player:addMana(math.random(min, max))
end
event[pid] = addEvent(function() player:autoRege() end, t* 1000)
end
end
function onStepIn(creature, item, position, fromPosition)
local player = Player(creature)
if player:isPlayer() then
return true
end
player:autoRege()
return true
end
function onStepOut(creature, item, position, fromPosition)
local player = Player(creature)
local pid = player:getGuid()
stopEvent(event[pid])
return true
end
<movevent event="StepIn" actionid="7454" script="ARQUIVO.lua" /> <movevent event="StepOut" actionid="7454" script="ARQUIVO.lua" />
Coloque actionid 7454 no piso pelo RME.






info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha
Galera, tudo bom?
Preciso de um piso que enquanto o player estiver em cima dele, ele vai recebendo uma quantia aleatória de mana entre 1 e 25... neste mesmo piso, ele vai recuperando pontos de stamina(menos a bônus)... se for possível é claro!
Uso tfs 1.1. Grato.