Script Not Loading Without Task.Wait(10)

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

There are three events;

RunService.HeartBeat
RunService.RenderStepped
RunService.Stepped

(I GUESS)

But why then @remcodesremcodes said it can be accessed by the server?

Runservice.Heartbeat is better if you are not coding a camera/character.
Also, it is not restricted to clients. Only RenderStepped is.

1 Like

Wait so yes or no, can it be accessed by the server?

The server cant change the UI because the ui is made after the playeradded event fires, causing it to error. And the task.wait() fixes that.

Also why do you want to use runservice? Theres no point tbh.

So why they said it can? I said it can’t, then they said it can, then you said it can’t. AA what’s happening???

RunService is better than while loops most cases.

1 Like

PlayerGui can be accessed by the server, though it does not run like a local script so it cannot run in ReplicatedFirst or the Player’s Character*.

*You are able to place Server Scripts inside a character if workspace.RejectCharacterDeletions is enabled.

1 Like

it can, it just cant in this case because the ui isnt in the game when the event fires.