I need him to walk at walk speed 15 when his hp gets to 32500 and i dont know why this script wont work can somebody pls help (i put it in his humanoid)
function rage() local hp = script.Parent.Health if hp <32500 then script.Parent.WalkSpeed = 15 end end script.Parent.Health.HealthChanged:Connect(rage)
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.