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

Playing gone wrong!?

Asked by
Tor6 0
10 years ago

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?

0
It says that 'PlayerGui is not a valid thing of Player' in the server console. Tor6 0 — 10y

1 answer

Log in to vote
0
Answered by
Destrings 406 Moderation Voter
10 years ago

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.

0
I'm using a while true do loop. Tor6 0 — 10y
0
Also, I think acctually it's because of an error. It says that 'PlayerGui is no a valid thing of Player'. Tor6 0 — 10y
0
Then, either you are trying to access another PlayerGui from a different client or PlayerGui has not loaded. Try LocalPlayer:WaitForChild("PlayerGui") Destrings 406 — 10y
Ad

Answer this question