It said "Players.tecknobladee.Backpack.TheSwordName.Script:4: attempt to index nil with 'WalkSpeed'" How do I fix it?
script.Parent.Equipped:Connect(function(char) local h = char:WaitForChild("LocalPlayer",10) h.WalkSpeed = h.WalkSpeed * 1.20 end)
The reason it didn't work, is cause when you Say Char its not the character, its the players mouse
so the solution is easy
when you equip the tool, the tool goes into the character so we can say
local Character = script.Parent.Parent
then we can adjust the walk speed
Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed * 1.2
Note: attempt to index nil means that the property you are getting dosn't exist
script.Parent.Equipped:Connect(function(PlayerMouse) local Character = script.Parent.Parent Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed * 1.2 end)
Local player is not a member of character character is a member of local player
script.Parent.Equipped:Connect(function(char) local h = char:WaitForChild("Humanoid",10) — I’m assuming char is character h.WalkSpeed = h.WalkSpeed * 1.20 end)