✓ Accepted answer
Instead of wait(), make the script check the value when the value itself declares it has changed.
All Instances in Roblox contain a Changed event, which fires whenever a Property of the Instance it fired from changes. Supposing you are using an IntValue or a NumberValue, you can use said Changed event to modify the value.
Here's the fixed portion of the script:
local P = game.Players.LocalPlayer
P.bin.Rage.Changed:connect(function(rage)
if rage > P.bin.MaxRage.Value then rage = P.bin.MaxRage.Value end
end)
EDIT: Shoot, i've been ninja'd by a moderator. The solution i bring you is more effecient than his because, instead of inspecting the amount of rage every time wait() is invoked, it inspects the value every time it is declared that it has changed. It should help run the game faster if you are gonna have many scripts in there.
His solution fixes your script and he is actually right on that - you are only using one end for two statements. Putting wait() in place of true when your while statement has a wait() at the beginning also improves effeciency - when this happens, the while statement is invoked every time the script has waited for the duration of wait().
RE-EDIT: Welp, guess the mod's answer got accepted. And i thought i was the one who got this easy one first :(
At least now i know there actually are people willing to help here in Scripting Helpers.
RE-RE-EDIT: Hey, my answer got accepted! Awesome!