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

StarterGui for all players or just one?

Asked by
trecept 367 Moderation Voter
6 years ago

I have a GUI in StarterGui that's a shop. I have values to check whether an item is bought or not inside each button, and when a player buys an item the value turns true. Will turning the value to true in the startergui for one player who has bought an item show to everyone as having it? Or if the player clicks a button to turn it red, if I change the colour red in the startergui will it only show to the player who made it red or everyone?

1 answer

Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
6 years ago
Edited 6 years ago

Hello, trecept. This is a common mistake for beginners but StarterGui is a service object that holds GUIs and LocalScripts. Everything under startergui wil be put under each player's PlayerGui when their character spawns. Example Path:

game.Players.LocalPlayer.PlayerGui

"Will turning the value to true in the startergui for one player who has bought an item show to everyone as having it? Or if the player clicks a button to turn it red, if I change the colour red in the startergui will it only show to the player who made it red or everyone?"

Answer: Yes, because you are using StarterGui instead of PlayerGui, StarterGui will affect everyone's Gui after they respawn. You have to use PlayerGui instead of StarterGui for any scripts like the one you mentioned above.

0
Ah, thanks! So I can change any value in a player's playergui for it to only show to them? trecept 367 — 6y
0
Yes, exactly. Elixcore 1337 — 6y
Ad

Answer this question