Script Not Loading Without Task.Wait(10)

What about changing the While loop to a RunService?

2 Likes

PETPWER’s solution worked, so I doubt that would work and frankly don’t want to try. If anyone else thinks this works though let me know.

2 Likes

You seem knowledgeable though. Why was this the reason for the issue? You can’t access the PlayerGui on the server?

2 Likes

Changing that to runservice is still better.

2 Likes

The PlayerAdded function was firing before the ui was even in the game, which is why you saw when you put task.wait() in front, it would work fine. Also, having it so anything on ui should be client sided as its just better overall for the client to control their own ui that only they will see.

1 Like

The PlayerGui is something just the player can access and change. The UI is replicated to the PlayerGUI which the serverscript cannot access. Got it? Why shouldn't you change ui from the server

1 Like

so playergui can only be accessed by the client? or can it be accessed by server at all?

1 Like

PlayerGui can be access by the server.

PlayerGui can be accessed by the server.

oh ok so its because player added was firing before the ui loaded?

1 Like

i am unfamiliar with runservice how would I do this?

Can? Then why when I did that it wasn’t running at all?

Could you dm me a message containing me a script, it’d be off topic if I solved it here.

1 Like

so it cant be accessed by the server LOL???

??? But the other one said it can

Oh wait can it i dont know? But if it can how can i fix my code using your method with runservice out of curiosity?

RunService | Documentation - Roblox Creator Hub Here

RunService.Heartbeat would work in this case.

1 Like

This means it can’t right? It can only be accessed on the client according to this?

Thank you. But I don’t understand why if the server cant change the playergui apparently.

1 Like