Re: How to make HP regeneration
You need to use lua.
Here's some code, save it to a lua file and set an actor's scriptpath to point towards it. The actor will heal 1 hp every 0.5 seconds.
Code:
dofile("Base.rte/Constants.lua")
require("Actors/AI/NativeHumanAI")
function Create(self)
self.AI = NativeHumanAI:Create(self)
self.HealTimer = Timer()
self.HealTime = 500 --Healing time: change this to make the healing go faster/slower. currently set to 500 miliseconds
end
function UpdateAI(self)
self.AI:Update(self)
end
function Update(self)
if self.Health < 100 then
if self.HealTimer:IsPastSimMS(self.HealTime) then
self.Health = self.Health + 1 --Healing amount: change this to make the healing go faster/slower. Currently set to 1 hp
self.HealTimer:Reset();
end
end
end