Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Fri Jan 28, 2022 7:00 am Post subject: Regeneration logic |
|
|
Let's say, you have game where shield and health is exist,but when you made regeneration code(for health and for shield),losing health and shield,there's no regeneration sort(first to regenerate health,then shield,but it won't at all),so here's solution(insert this code into your shield regeneration code):
| Code: | local health = readFloat("healthAddress") --replace address
local maxHealth = readFloat("maxHealthAddress") --replace address
local canRegenerate
if health => maxHealth then
canRegenerate = true
else
canRegenerate = false
end
if not canRegenerate then return end |
|
|