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
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.