I'm making a script thats inside a part, so whenever someone with a humanoid touches it, the script changes their walkspeed to 65. But it doesn't work!
Script:
script.Parent.Touched:connect(function(hit) local hum = hit.Parent.Humanoid if hum then hum.Walkspeed = 30 else print("No hum") end end)
Please help?
script.Parent.Touched:connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") --Changed to :FindFirstChild("Humanoid") if hum ~= nil then --Added ~= nil hum.WalkSpeed = 30 --Capitalized the S else print("No hum") end end)