Hello, I found this piece of code off the internet for a test project. It is supposed to make your character gradually gain speed when it moves. However, I keep getting the error "Humanoid is not a valid member of Player" Here is the script in question:
chr = game.Players.LocalPlayer hum = chr.Humanoid inrate = 0.2 -- how fast it increases decayrate = 0 -- how fast it decreases inamount = 1 -- how much it increases deamount = 0.5 -- how much it decreases max = 16 -- the max speed speed = 0 -- no need to change this spawn(function()
while wait(decayrate) do
if speed > 0 and hum.MoveDirection == Vector3.new(0,0,0) then
speed = speed - deamount
hum.WalkSpeed = hum.WalkSpeed - deamount
end
end
end) while wait() do while hum.MoveDirection ~= Vector3.new(0,0,0) and (speed+inamount) < max do wait(inrate) speed = speed + inamount hum.WalkSpeed = hum.WalkSpeed + inamount
end
end
Could somebody please tell me what is wrong and how I can fix it? Any help is appreciated.

1 comment
Well first of all, where is the script at, Because there are no humanoids that control the physical character in game.Players, and that script is sketchy