Roblox 'Infinite yield possible on WaitForChild' – Fix
The error
Infinite yield possible on 'ReplicatedStorage:WaitForChild("RemoteEvent")'
What it means
This is a warning, not an error. WaitForChild printed it because the object didn't appear within 5 seconds. Usually the name is misspelled, the path is wrong, the object is created by a script that never runs, or a LocalScript is waiting for something that only exists on the server (e.g. in ServerStorage).
The fix
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Check spelling/case exactly matches the Explorer
local remote = ReplicatedStorage:WaitForChild("RemoteEvent", 10) -- 10s timeout
if not remote then
warn("RemoteEvent missing from ReplicatedStorage")
return
endPut objects clients need in ReplicatedStorage (not ServerStorage). Passing a timeout makes WaitForChild return nil instead of yielding forever, so you can handle it.
Related tools: Roblox script generator · Roblox Lua error fixer · all script generators