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
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")