So I’ve tried a few things for this. I’m looking to make an HP “increase” script that increases the player’s HP to 130. The issue is, you cannot just use ply:SetHealth(130) because players can abuse this, by simply un-equipping it and re-equipping it.
For context, this is a pointshop item.
So, I tried this:
function ITEM:Think(ply, modifications) if SERVER then ply:SetMaxHealth( 130 ) ply:SetHealth( math.Clamp( ply:Health() + 0.001, 100, 130 ) ) end end
It regens to 130, which is the plan. The issue here is that I want it to only regen if the player is above 100 hp. I have no idea how to do this, and for some magic reason I thought clamping it to 100 would allow the player to die and go below 100 but no, it does not, which I guess makes sense since I used it wrong.
What would be a way to edit this so that it only regens the player slowly to 130, if they are above 100?
Thanks in advance.