Can I use game.Players.(playername).PlayerGui.(stuff) in a SSS Script?

The title says it all. I want to know if I can use

game.Players.(playername).PlayerGui.(stuff)

(Assume that “(playername)” and “(stuff)” are valid children.)

1 Like

Yes, it is a thing that is possible for the Server to do, as I’ve used it a few times as well, although if you’re doing it instantly when a player joins, you need to wait for the PlayerGui to exist, else it will error.

2 Likes

Thank you! Quick follow up, can I detect if a GUI button has been clicked through PlayerGui?

1 Like

You’d have to do that on a localscript in the button itself, or somewhere where a localscript will work and reference the button and use the MouseButton1Click event on the button, I am unsure if it works on server scripts, probably not

3 Likes