Hi, I am very new to Roblox and coding I need help with one of my first codes. My code:
script.Parent.Touched:connect(function(hit) local Humanoid = hit.Parent:FindFirstChild("Humaoid") Humanoid.WalkSpeed = 50 end)
I want to make a speed run so I made this code for Padboost but it is not working,
it says:
Workspace.Part.Script:3: attempt to index local 'Humanoid' (a nil value)
Can you help me, please?
Thank you,
GWA001
Could you format your question better with a code block next time? Thanks. Anyways if the brick is on the ground then the ground can touch it. Here's what you have to do to check if the object touched is the player:
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChildOfClass("Humanoid") then -- local Humanoid = hit.Parent:FindFirstChild("Humaoid") -- you mispelt Humanoid up there, use FirstChildOfClass instead local Humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") Humanoid.WalkSpeed = 50 end end)
Yeah that's it m