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

How do I make a class selection GUI for a specific team?

Asked by 9 years ago

For example, if a player chooses red team, they would get a class selection GUI unique only to red team. I've tried putting it in starterGUI, but that is visible to players on both teams.

2 answers

Log in to vote
0
Answered by
pauljkl 10
9 years ago

Another alternative is to have the GUI only clone into players on the certain team whenever they spawn, for example:

game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(char)
        if p.TeamColor.Name == "Bright red" then -- If you just want Bright red players having it
            p:WaitForChild("PlayerGui")
            game.ServerStorage["GUINAME"]:clone().Parent = p.PlayerGui
        end
    end)
end)
0
Thanks! This worked as well! BartyCrouchJunior 57 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

You could put the script into StarterGui and hide everyrhing, then check the players team and if it matches then make the guy visible.

Something along the lines of this in a localscript.

Plr = game.Players.LocalPlayer

If Plr.TeamColor == BrickColor.new ("TEAM COLOR") then
-- make it visible. 
end
0
How do I make it visible though? BartyCrouchJunior 57 — 9y
0
By setting the visible feature on. Do some research on the wiki, youll find some example scripts. I will not just give you the script, how will you learn? Search on wiki.roblox.com for Visibility or something. AmericanStripes 610 — 9y
0
Yep, I will research on the wiki. Thanks for your help! BartyCrouchJunior 57 — 9y
0
To make it visible do Gui.visible = true yoshiegg6 176 — 9y

Answer this question