The server proves that the instance called exists, but for some reason the :WaitForChild() stays stuck in an infinite yield.
LOCAL SCRIPT:
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local hrp = Character:WaitForChild("HumanoidRootPart")
local stand = Character:WaitForChild("Stand")
local StandRightArm = stand:WaitForChild("Stand Right Arm")
There is no misspellings or anything of that sort. What exactly is the issue here?
Before the Right Arm there’s a :WaitForChild("Stand Head")
But somehow that one works just fine. So I don’t think the issue is related to the code syntax.
you can add a condition that if it does not find it, it waits a few tenths of a second to repeat the same actions again
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local hrp = Character:WaitForChild("HumanoidRootPart")
local stand = Character:WaitForChild("Stand")
local StandRightArm = stand:FindFirstChild("Stand Right Arm")
if StandRightArm == nil then
task.wait(0.3)
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local hrp = Character:WaitForChild("HumanoidRootPart")
local stand = Character:WaitForChild("Stand")
local StandRightArm = stand:FindFirstChild("Stand Right Arm")
end
It’s not gonna work, it’s gonna work for Spaced Letters Without :WaitForChild, :FindFirstChild, etc…
To use [], use it for Spaced Letters, like game.Players.LocalPlayer.PlayerGui["Random ScreenGui"]["Random Frame"]["Random TextButton"] Or for Dataload, to be like Currency_1.Value = Dataload[1]. Or for player on Workspace, use workspace[game.Players.LocalPlayer.Name] Which is the PlayerName. Like mine, if you use it, it’s going to be located as “kdopdaux1803”.
Why not add a timeout? local StandRightArm = stand:WaitForChild("Stand Right Arm" , 20)
The script will search for said instance for 20 seconds until it times out if it doesn’t find any.
Maybe I’m wrong about the default value (It’s actually 5 seconds) but nonetheless I have tried to set the timeout as math.huge and the error persisted
Not how WaitForChild works, If the function never finds what it’s looking for, It completely halts the code. hence the "Infinite Yield" part of the warning
This is the WaitForChild description: Returns the child of an Instance under the given name, If the child does not exist, it will yield the current thread until it does.
After that condition is never met, It halts the code.
WaitForChild has a Time out by Default, Time out Argument is just so you can change it manually instead of having 5 as the default