1
0
Fork 0
forked from Simnation/Main
Main/resources/[standalone]/illenium-appearance/client/stats.lua
2025-06-07 08:51:21 +02:00

28 lines
720 B
Lua

local stats = nil
local function ResetRechargeMultipliers()
SetPlayerHealthRechargeMultiplier(cache.playerId, 0.0)
SetPlayerHealthRechargeLimit(cache.playerId, 0.0)
end
function BackupPlayerStats()
stats = {
health = GetEntityHealth(cache.ped),
armour = GetPedArmour(cache.ped)
}
end
function RestorePlayerStats()
if stats then
SetEntityMaxHealth(cache.ped, 200)
Wait(1000) -- Safety Delay
SetEntityHealth(cache.ped, stats.health)
SetPedArmour(cache.ped, stats.armour)
ResetRechargeMultipliers()
stats = nil
return
end
-- If no stats are backed up, restore from the framework
Framework.RestorePlayerArmour()
end