What is the difference? I dont get why startergui doesnt work and i dont know how to access the playergui.
When you put a GUI in StarterGui it automatically duplicates itself with the properties that it was created with into the PlayerGui folder of every player, therefore, by changing it there you are changing the default one.
every single gui in startergui gets replicated to the playergui
if you try to enable/disable a ui in startergui, when the player respawns, that ui will ALWAYS be invisible
if you do the same thing but it the players gui, then it’ll show on their screen, and when they respawn the ui will be visible again
The starter gui is where you can store needed guis/other things. Everything in the starter gui is duplicated into the players’ player gui (what they see). This is just like starter pack and backpack.
Just another way to look at it:
StarterGUI is used inside the studio when you’re working on the GUI.
Once in the game, anything in “StarterGUI” becomes “PlayerGUI”
Does that mean i could access it by game.PlayerGui?
Nope, you’d need to get the actual player variable! Something like this in a LocalScript:
local Player = game.Players.LocalPlayer
local PlayerGui = Player:WaitForChild('PlayerGui')
local ScreenGui = PlayerGui:WaitForChild('')
And in a ServerScript, something like this:
local Players = game:GetService('Players')
Players.PlayerAdded:Connect(function(Player)
local PlayerGui = Player:WaitForChild('PlayerGui')
local ScreenGui = PlayerGui:WaitForChild('')
end)
The difference is the StarterGui replicates (Duplicates) everything to the PlayerGui, which means changing something in StarterGui won’t affect anything until the player resets.
It’s like baking. When you add baking powder to the cake, but you realize you added too much, it will only take effect once it’s in the oven. Same thing here: If you change something in StarterGui, it will only take effect when a player resets and it has to duplicate to the player again.