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

Can someone explain how GUI's communicate with things like serverscripts?

Asked by 6 years ago

Sometimes I am able to change a gui through a server script. Sometimes it does not work, Why is this? Could somebody explain the relationship of GUI's and the rest of the game

1 answer

Log in to vote
3
Answered by
Avigant 2374 Moderation Voter Community Moderator
6 years ago

When you use Play Solo testing, there is no separation of server and client. If you'd like that, try Test Server instead.

The server can access the player's PlayerGui server-side, but when a client adds something to their PlayerGui (i.e. from game.StarterGui), the server doesn't know about it, so in practice the server only knows about GUIs it parented. Furthermore, the server should not ever attempt to change any GUI for any reason, that's the responsibility of the client.

Use a RemoteEvent and fire the client, and let the client decide how to handle the GUI changes.

Helpful resource:

http://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events

0
Thank you for this explanatory explanation you are very helpful :) 4d61736f6e 59 — 6y
Ad

Answer this question