Script Not Waiting For The Game To Load

Hello, I have been wondering this for 1 year and it’s time to ask! Why is it when I use a localscript in ReplicatedFirst, I do:

1: local Humanoid = game.Players.LocalPlayer.Character:WaitForChild(“Humanoid”)

or even:

1: local Humanoid = game.Players.LocalPlayer.Character.Humanoid

the script doesn’t wait. But then I do

repeat wait()

until game:IsLoaded()

or even:

repeat
wait()
until game:IsLoaded

None of those work sadly. Any ideas on how to make the script wait? I know I should add a wait so how long of a wait should it be?

1 Like

try this

local plr = game:GetService(“Players”).LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local Humanoid = char:WaitForChild(“Humanoid”, 5)

1 Like