Humanoid is not a valid member of Model "Workspace.Username"

Basically I have a local script that dashes in a direction depending if you’re holding whether W/A/S/D.
And it works perfectly in studio but in-game it’s sometimes broken and sometimes not and the developer console just prints out "Humanoid is not a valid member of Model “Workspace.Username”.

Here’s the line that is apparently an error:

local sss = game:GetService("Players").LocalPlayer`
repeat
wait()
until sss.Character and sss.Character.Humanoid

Anything I can try to fix this?

sss.Character:WaitForChildOfClass("Humanoid")

It depends on where you really put the LocalScript, also might I suggest that you use WaitForChild() so that you’re certain that there is a Humanoid

You don’t need a repeat-wait()-until loop. You can just use :WaitForChild() and :Wait() for waiting humanoid to load:

local sss = game:GetService("Players").LocalPlayer`
local Character = sss.Character or ss.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")