local USI = game:GetService("UserInputService") local damage = 50 local Handle = script.Parent.Handle local rep = game.ReplicatedStorage local CanSprint = rep.BoolValues.CanSprint script.Parent.Equipped:Connect(function(equip) local plr = equip.Parent local Humanoid = plr:FindFirstChild("Humanoid") Handle.Transparency = 1 USI.InputBegan:Connect(function(input) local keycode = input.KeyCode if keycode == Enum.KeyCode.F then Handle.Transparency = 0 Humanoid.WalkSpeed = 40 CanSprint = false end end) USI.InputEnded:Connect(function(input) local keycode = input.KeyCode if keycode == Enum.KeyCode.F then Handle.Transparency = 0 Humanoid.WalkSpeed = 16 CanSprint = true end end) end)
Instead of
local plr = equip.Parent local Humanoid = plr:FindFirstChild("Humanoid")
try doing
local plr = game:GetService("Players").LocalPlayer local Humanoid = plr.Character:FindFirstChild("Humanoid")
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
try doing this:
script.Parent.Equipped:Connect(function() local plr = script.Parent.Parent local Humanoid = plr:WaitForChild("Humanoid",0.1) -- rest of your code here end)