First off, is that a LocalScript or a Server Script?
If that’s a Server Script then insert a LocalScript inside your tool and paste this in:
local p = game:GetService("Players").LocalPlayer
local char = p.Character or p.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local defaultSpeed = humanoid.WalkSpeed
local customSpeed = 00 --How fast you want to go.
local Tool = script.Parent
Tool.Equipped:Connect(function()
hum.WalkSpeed = customSpeed
end)
Tool.Unequipped:Connect(function()
hum.WalkSpeed = defaultSpeed
end)
If that’s a LocalScript and it is inside your tool then you can copy and paste the code above into your script.