Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

access the startgui?

Hi I was trying to access the startergui from a script in the workspace. Can you help?

for _, player in pairs(players) do -- Cycles through all the objects, players or not, in the "Players" service object.
  if player:IsA("Player") then -- Makes sure it's a player, not some other object.
    local starterGui = player.StarterGui
    game.StarterGui.ScreenGui.TextLabel.Visible = true
  end
end

1 answer

for _, player in pairs(players) do
  if player:IsA("Player") then 
    local playerGui = player.PlayerGui
    game.StarterGui.ScreenGui.TextLabel.Visible = true
  end
end

This works because the original script was calling on the 'ScreenGu'i that is in game.StarterGui, whereas this script is calling on the Gui that the player gets when the server starts. Otherwise meaning, player.PlayerGui is the Gui that only that certain player can view. If that is complicated, reply and I will try to be more in-depth about it

1 comment

0

doesn't work and no output...

This discussion is preserved as it was. New answers, comments, and votes are closed.