I think the problem is, you're putting Jan into StarterGui.
What I mean by this is that, StarterGui doesn't replicate its descendants to the server.
So you're the only one that can see Jan.
There are a couple of fixes you can do.
Fix 1:
Putting Jan into PlayerGui manually by a script.
You could let the server get Jan, put it into the player's `PlayerGui', and then editing it.
That way the server and the client will be able to access it.
Fix 2:
Not letting the server enable the ScreenGui, but let the client do it
You might be wondering, "If I let the client change the properties, wouldn't it not replicate?"
That is correct. So why do we let the client do it? Because the client is the only one that's going to see the ScerenGui.
In other words, No one else but you has to see your ScerenGui, since it'll only show for you.
So how do we enable the ScerenGui from the client? Simple, we don't even need the RemoteEvent. We keep Jan in StarterGui, and then just simply:
game:GetService("Players").LocalPlayer.PlayerGui.Jan.Enabled=true
Notes:
You should use :WaitForChild() if you're immediately accessing an object, since it might not be loaded in yet.
It'll wait until the object you're waiting for is loaded in the game.
In this case, we just
game:GetService("Players").LocalPlayer.PlayerGui:WaitForChild("Jan").Enabled=true
Basically, when you're editing a ScreenGui, you only have to do it on the client since that client will be the only client that will see the ScerenGui you're editing.
I'm sorry if anything I said wasn't explained well, I hope this helped you in any way.
If you have any questions I will try to answer them when I'm online.
1 comment
Thank you i was wondering whats wrong but i noticed that i tries turning the Gui on usig a script not a local script im so stupid