I am having trouble finding the difference between PlayerGui and StarterGui. I checked the forums, videos, and the wiki didn’t make sense at all. I even experimented myself. What I did was make a button and whenever you click it… It goes on a while loop and changes the color to random. So, I referenced the button in PlayerGui and StarterGui and it both worked as intended to. Any response it appreciated!
basically, the server has the startergui, anything edited there will replicate across everyone’s player gui, however, if you were to change something from within a player’s “playergui”, it would only show for them.
You wouldn’t really edit the startergui in scripts nearly as much as you would the player gui, or at least I wouldn’t suggest it.
StarterGui is a service, anything inside it is replicated to each player’s PlayerGui PlayerGui is an individual player’s GUI, changes to their UI won’t affect other clients
So if I would like something to happen only to the player that triggered it, I’d use playergui, but if I’d want something to happen to everyone, I’d use startergui?
Not entirely, if you wanted something to happen for everyone, I’d suggest changing all players playerguis instead of directly manipulating the startergui.
Changing anything within StarterGui won’t do anything. It won’t replicate. So instead, use an event and make sure a local script inside the gui receives it, which will then change for everyone.
-- Server
local Event = game.ReplicatedStorage:WaitForChild('RemoteEvent')
Event:FireAllClients('Hello world!')
I did reference the startergui. Saying script.Parent in a local script inside startergui is referencing startergui because the button is inside the startergui.