Hello, so I am working on a MainMenu and recently I have encountered an error that is just bugging me. The error is occuring in a LocalScript which is located in a ScreenGui in ReplicatedFirst that is then given to the player’s PlayerGui. The error in the output is:
"Infinite Yield Possible on “ReplicatedStorage:WaitForChild(“ChangeTeam”)”
The relevant part of the script is:
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("ChangeTeam")
I tried using only using game.ReplicatedStorage:WaitForChild(“ChangeTeam”) and game.ReplicatedStorage.ChangeTeam but both didn’t work too and got the same error. Any solutions would be really appreciated!
local ReplicatedStorage = game:GetService("ReplicatedStorage")
repeat wait()
if
ReplicatedStorage:FindFirstChild("ChangeTeam")
then break
end
local RemoteEvent = ReplicatedStorage.ChangeTeam