Roblox Studio warning

Infinite yield possible on

What Infinite yield possible on means in Roblox Studio, the four things that cause it with the code that triggers each, and the fix for each one.

Updated 23 October 20264 min readWarningLuau

In short

WaitForChild("Name") pauses the script until a child with that name exists. After 5 seconds without one (and with no time-out given), Roblox prints this warning in orange. The script is still waiting, and nothing after that line runs until the child appears, which may be never. The part in quotes tells you exactly what it is waiting for and where: Players.Builderman:WaitForChild("leaderstats") waits for leaderstats inside the player.

  • Check the spelling and capitals first: leaderStats never matches leaderstats.
  • Then check that something actually creates that object, and that the client is allowed to see where it lives.
  • Give WaitForChild a time-out (a second argument) when the object might never come, and handle the nil it then returns.
On this page
  1. What it means
  2. Causes and fixes
  3. Fix it with RoCode
  4. Find the line
  5. Questions
  6. Sources

What the message means

Output (example)
Infinite yield possible on 'Players.Builderman:WaitForChild("leaderstats")'

Other forms of the same message:

  • Infinite yield possible on 'ReplicatedStorage:WaitForChild("Remotes")'
  • Infinite yield possible on 'Players.Builderman:WaitForChild("Character")'
  • Infinite yield possible on 'Workspace:WaitForChild("Map")'

It is a warning, not an error: the script did not stop with a red line, it is stuck waiting. That is why a game can sit there doing nothing with only this orange line in Output.

Roblox prints it 5 seconds into the wait. If the object turns up later, the script carries on as if nothing happened, so a warning that appears and then the game works means the object is simply slow to arrive, which is fine.

Causes and fixes

Four things cause this warning in practice. Each one below has the smallest code that triggers it, then the fix.

The name or the parent is wrong

Names must match exactly, capitals and spaces included. Waiting on the wrong parent never finishes either: a RemoteEvent in a Remotes folder is not a direct child of ReplicatedStorage.

Breaks LocalScript in StarterPlayerScripts named Shop
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- the event lives in ReplicatedStorage.Remotes, so this waits forever:
-- Infinite yield possible on 'ReplicatedStorage:WaitForChild("BuyItem")'
local buyItem = ReplicatedStorage:WaitForChild("BuyItem")

Copy the path from the Explorer and wait for each level.

Fixed LocalScript in StarterPlayerScripts named Shop
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remotes = ReplicatedStorage:WaitForChild("Remotes")
local buyItem = remotes:WaitForChild("BuyItem") :: RemoteEvent
buyItem:FireServer("Sword")

Nothing creates the object

leaderstats exists only if a server Script makes it. If that script is disabled, in the wrong place (a Script in ReplicatedStorage does not run), or errored before it got there, every WaitForChild("leaderstats") waits forever. Look for an earlier red error in Output.

Breaks LocalScript in StarterPlayerScripts named CoinsLabel
local Players = game:GetService("Players")

local player = Players.LocalPlayer
-- no server script makes leaderstats:
-- Infinite yield possible on 'Players.Builderman:WaitForChild("leaderstats")'
local leaderstats = player:WaitForChild("leaderstats")
print(leaderstats)

Make sure a server Script in ServerScriptService creates the object when the player joins.

Fixed Script in ServerScriptService named Leaderstats
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player: Player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"

	local coins = Instance.new("IntValue")
	coins.Name = "Coins"
	coins.Parent = leaderstats

	leaderstats.Parent = player
end)

The leaderboard guide builds this script fully, with saving.

A LocalScript waits for something in ServerStorage or ServerScriptService

The contents of ServerStorage and ServerScriptService are never sent to players. A LocalScript waiting there waits forever, even though you can see the object in Studio.

Breaks LocalScript in StarterPlayerScripts named Inventory
local ServerStorage = game:GetService("ServerStorage")

-- clients never receive ServerStorage's contents:
-- Infinite yield possible on 'ServerStorage:WaitForChild("Sword")'
local sword = ServerStorage:WaitForChild("Sword")

Move things the client needs into ReplicatedStorage. Keep things only the server should touch in ServerStorage, and have a server Script hand them out.

Fixed LocalScript in StarterPlayerScripts named Inventory
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local items = ReplicatedStorage:WaitForChild("Items")
local sword = items:WaitForChild("Sword", 10)
if sword == nil then
	warn("[Inventory] no Sword in ReplicatedStorage.Items")
end

You are waiting for a property, not a child

WaitForChild only finds children. player:WaitForChild("Character") is the classic: Character is a property of Player, so no child with that name ever appears.

Breaks LocalScript in StarterPlayerScripts named Sprint
local Players = game:GetService("Players")

local player = Players.LocalPlayer
-- Character is a property, not a child:
-- Infinite yield possible on 'Players.Builderman:WaitForChild("Character")'
local character = player:WaitForChild("Character")

Read the property, and wait with its event when it is not set yet.

Fixed LocalScript in StarterPlayerScripts named Sprint
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
print(character.Name)

With StreamingEnabled on (Workspace property), parts far from the player may not have reached that client yet, which also looks like this warning. Wait with a time-out, or keep what the client always needs out of streaming.

Fix it in your place

Paste the error, RoCode fixes it in your place

Copy the line from Output and paste it here. RoCode opens the script it names in the place you have open in Studio, works out which of the causes above it is, and edits the code there instead of handing you a snippet to paste.

For example: Infinite yield possible on 'Players.Builderman:WaitForChild("leaderstats")'

RoCode is an AI agent for Roblox Studio: it reads the scripts in the place you have open, finds the line and edits it there, and every change is an undo point. It runs on Windows or macOS with a desktop browser. Free to start, with free credits every day.

How to find the line that causes it

  1. The text in quotes names the object it is waiting on and the child it wants: 'Players.Builderman:WaitForChild("leaderstats")'.
  2. Search your scripts for that child name with Ctrl+Shift+F (Find All) to find every WaitForChild that waits for it.
  3. If Output shows a script name and a line number with the warning, click it to jump straight there.
  4. Then look in the Explorer, during Play, at the object named in the warning: is the child there, under that exact name? During Play you can switch the Explorer between the client and the server view, to see what each side really has.

Questions

Is Infinite yield possible an error?

No, it is a warning, shown in orange. The script has not crashed; it is still waiting on that line, so nothing below it runs until the child appears.

How do I stop the warning?

Fix the cause: the name, the parent, or the script that creates the object. If waiting forever is never right, pass a time-out: parent:WaitForChild("Name", 10) returns nil after 10 seconds instead of warning, and your code can handle it.

Why do I see it for leaderstats?

Nothing created a leaderstats folder in that player, or it is spelled differently. A server Script has to make it on PlayerAdded.

Should I use WaitForChild everywhere?

Use it in LocalScripts for things that come from the server, and on the server for things made at runtime. For things that are always there when the server starts, a server Script can use the direct path or FindFirstChild.

Can RoCode fix it?

Yes. Paste the warning into RoCode. It checks the Explorer of your open place for the object, fixes the name or the path, or creates what is missing.

Sources and further reading

How the code was checked: every block marked Fixed passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 23 October 2026), and every block marked Breaks compiles and fails only when it runs. The message wording was checked against the message strings in Roblox Studio itself (macOS build of 13 October 2026) and the WaitForChild reference on 23 October 2026. A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.

Stop hunting errors line by line.

RoCode reads the scripts in your open place, fixes the error where it happens and tells you what it changed. Free every day, no card required.