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

How do I do "StarterGui" for a specified player? [closed]

Asked by
Arayu -7
6 years ago

How do I do "StarterGui" for a specified player? ; How do I do "StarterGui" for a specified player?

Closed as Not Constructive by TheHospitalDev, Thundermaker300, and lukeb50

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 6 years ago

It'd be good if you'd elaborate.

Here's the two things you might mean:

  • PlayerGUI

Anything in StarterGUI is copied to this. It is in each player, provided their character has spawned. It's just referenced by game.Players.PLAYERNAME.PlayerGUI.

  • Choosing what each player gets as a StarterGUI

These wouldn't actually be put in StarterGUI. This'd be achieved by something like:

local gui1 = script.Parent.GUI1
local gui2 = script.Parent.GUI2

game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(c)
        if p.Name == "CoolDude" then
            gui1:Clone().Parent = p.PlayerGUI
        else
            gui2:Clone().Parent = p.PlayerGUI
        end
    end)
end)    

Of course, this example is fairly basic, but hopefully you get the idea.

Thanks,

Explosion

Ad