Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Infinite yield possible on 'ReplicatedStorage:WaitForChild("RestartGame")'?

Asked by 2 years ago
Edited 2 years ago

I created a gui that has a text button, and when you click it, the whole game reloads but i got no error on the output but this happened: Infinite yield possible on 'ReplicatedStorage:WaitForChild("RestartGame")'?

I never had a problem like this please help...

Code:

          script.Parent.MouseButton1Click:Connect(function()
                                  local RestartGame = 
                      game:GetService("ReplicatedStorage"):WaitForChild("RestartGame")--When it appears
                                          RestartGame:FireServer()
                     end)
0
Double check and make sure that there is a Remote Event named "RestartGame" directly inside of Replicated Storage. WaitForChild() isn't picking up anything, meaning that you might have spelled something wrong, or it might just not even exist in Replicated Storage. DietCokeTastesGood 111 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

This can only mean one thing. RestartGame doesn't exist.

0
but its a remote event Altbotnot 9 — 2y
0
I get that but if tour using waitforchild but it says infinite yield, this means it just doesnt exist, if it sid, it would have loaded and wsitforchikd would work, maybe you made a spelling misake or accidentally put the remote event in the wrong place, please check these things AlexanderYar 788 — 2y
Ad

Answer this question