This is the script and it works adding speed but breaks when decreasing
local tool = script.Parent local Handle = tool:WaitForChild("Handle") tool.Equipped:Connect(function() local h = script.Parent.Parent:FindFirstChild("Humanoid") h.WalkSpeed = h.WalkSpeed + 20 end) tool.Unequipped:Connect(function() local h = script.Parent.Parent:FindFirstChild("Humanoid") h.WalkSpeed = h.WalkSpeed - 20 --Here is the problem. It says that walkspeed is not a valid member of Humanoid end)
local tool = script.Parent if script.Parent.Parent.Name == "Backpack" then character = script.Parent.Parent.Parent.Character else character = script.Parent.Parent end h = character:WaitForChild("Humanoid") tool.Equipped:Connect(function() h.WalkSpeed = h.WalkSpeed + 20 end) tool.Unequipped:Connect(function() h.WalkSpeed = h.WalkSpeed - 20 end)