How do i fix Infinite yield possible on 'ReplicatedFirst:WaitForChild(“Humanoid”) form showing up when using waitforchild?
show us your script if you want any help.
local gui = script:WaitForChild("LoadingScreen")
local plr = game.Players.LocalPlayer
gui.Parent = plr.PlayerGui
script.Parent:RemoveDefaultLoadingScreen()
script.Sound:Play()
repeat
wait(.5)
until game:IsLoaded()
local uis = game:GetService("UserInputService")
local ts = game:GetService("TweenService")
local ti = TweenInfo.new(0.5)
local cam = workspace.CurrentCamera
local hum = script.Parent:WaitForChild("Humanoid") -- here is the problem
local run1 = ts:Create(cam, ti, {FieldOfView = 60})
wait(3)
gui.Frame.StudioLogoHolder:TweenPosition(
UDim2.new(0.5, 0,0.475, 0),
"Out",
"Quad",
.2,
true
)
wait(1)
gui.Frame.Credits:TweenPosition(
UDim2.new(0.5, 0,0.525, 0),
"Out",
"Quad",
.2,
true
)
wait(9)
plr.PlayerGui.MainUI.PhoneMain.Visible = false
plr.PlayerGui.MainUI.RightMain.Visible = false
plr.PlayerGui.MainUI.LeftMain.Visible = false
plr.PlayerGui.MainUI.HealthDisplay.Visible = false
gui.Frame:TweenPosition(UDim2.new(0, 0, -1.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.7)
wait(0.5)
plr.PlayerGui.MainUI.Frames.SpawnTeams:TweenPosition(
UDim2.new(0.5, 0,0.5, 0),
"Out",
"Quad",
.2,
true
)
run1:Play()
wait(.3)
gui:Destroy()
Is this script in starter character scripts? otherwise it’s parent will not be a character.
Ok, is a humanoid in replicated first?? show us your explorer as well.
My mistake, I made it find the humanoid in the wrong place
2 Likes