Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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)

1 comment

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.

1 answer

✓ Accepted answer

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

2 comments

0

but its a remote event

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

This discussion is preserved as it was. New answers, comments, and votes are closed.