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

Team only GUI

Asked by 11 years ago

I know there is a way to make a Team-only GUI because most clans have it that way. Anyways, how do you make a GUI for one team ONLY?

2 answers

Log in to vote
1
Answered by
Aethex 256 Moderation Voter
11 years ago

The easiest way, to my belief, to do this would be to use the PlayerAdded event and check the player's team before they join. You could store the GUI in ReplicatedStorage and put a script in the Workspace to check if the player belongs to a certain team.

01game.Players.PlayerAdded:connect(function(plr)
02 
03    if plr.TeamColor == BrickColor.new("Bright red") then
04 
05        local gui = game.ReplicatedStorage.GUIName
06 
07        gui.Parent = plr.PlayerGui;
08 
09    end
10 
11end
Ad
Log in to vote
0
Answered by 11 years ago

if you wish to know how to make it only for a group here ya go

1game.Players.PlayerAdded:connect(function(p)
2local GroupId = 372 -- Scripting Helpers Group Id
3 
4    if (player:IsInGroup(GroupId)) then
5        local Group_Gui = game.ReplicatedStorage[GuiName]:Clone()
6        Group_Gui.Parent = p.PlayerGui
7    end
8end)

Answer this question