Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't this local script work, It's supposed to change speed?

I made this local script where it changes the speed of the player when equipped, unequipped, and activated but it doesn't work. Any help?

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local humanoid = char:WaitForChild("Humanoid")
local tool = script.Parent

function slowdown()
	humanoid.Walkspeed = 100
end

function freeze()
	humanoid.Walkspeed = 0
	wait(0.67)
	humanoid.Walkspeed = 10
end

function speedup()
	humanoid.Walkspeed = 16
end

tool.Actived:connect(freeze)
tool.Equipped:connect(slowdown)
tool.Unequipped:connect(speedup)

1 answer

✓ Accepted answer
tool.Actived:connect(freeze)

You just made a typo. The output would have told you where the error was, so in the future please try to catch these mistakes yourself :)

This needs to be:

tool.Activated:connect(freeze)

This discussion is preserved as it was. New answers, comments, and votes are closed.