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

Playing gone wrong!?

Okay, so I have a game that includes various functions and a continuous loop to run these functions. However it seems to run only in solo mode or otherwise local console if you use the developer console. And it doesn't run in regular mode or server console. Is there a general problem/solution to this or is this because of something specific in my game coding?

1 comment

0

It says that 'PlayerGui is not a valid thing of Player' in the server console.

1 answer

Sometimes the LocalScript runs before the GUI has been replicated. Add at the start

repeat wait() while game.Players.LocalPlayer

To ensure that the player exists before running the code.

3 comments

0

I'm using a while true do loop.

0

Also, I think acctually it's because of an error. It says that 'PlayerGui is no a valid thing of Player'.

0

Then, either you are trying to access another PlayerGui from a different client or PlayerGui has not loaded. Try LocalPlayer:WaitForChild("PlayerGui")

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