✓ Accepted answer
You're doing "script.Parent.Health.HealthChanged"
It should actually be
function rage()
local hp = script.Parent.Health
if hp <32500 then
script.Parent.WalkSpeed = 15
end
end
script.Parent.HealthChanged:Connect(rage)
.HealthChanged is a function that is used on the humanoid, not on the Health value.
https://developer.roblox.com/en-us/api-reference/event/Humanoid/HealthChanged
Also, if you plan on making it so the walkspeed changes at 32500, you should make it
if hp =< 32500 then
instead of
if hp < 32500 then
Using the latter would result in the script changing only when the health is less than 32500, in comparison to being equal to or less than.
2 comments
try doing
if hp <= 32500 thenTHX that works!