Hello I get a one issue with my code
code:
local tool = script.Parent
local player = game.Players.LocalPlayer
local char = player.Character
local humanoid = char:WaitForChild(“Humanoid”)
tool.Equipped:Connect(function()
if humanoid then
humanoid.WalkSpeed = 50
end
end)
tool.Unequipped:Connect(function()
if humanoid then
humanoid.WalkSpeed = 16
end
end)
that script has to change player walk speed when item is equipped to 50
issue its dont work because of something with nil and waitforchild
Error Message:
Players.vitopencilPro2020.Backpack.Bumper Car.LocalScript:4: attempt to index nil with ‘WaitForChild’ - Client - LocalScript:4
17:17:13.730 Stack Begin - Studio
17:17:13.730 Script ‘Players.vitopencilPro2020.Backpack.Bumper Car.LocalScript’, Line 4 - Studio - LocalScript:4
17:17:13.730 Stack End - Studio
17:31:47.803 Disconnect from ::ffff:127.0.0.1|55433 - Studio
one time its work and changed my walk speed but next time its didnt work I dont try any solutions because I dont know what I can do
Im trying to do something with it but its always dont work