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

How do I get a specific team to get this GUI?

I made this localscript so that when a player clicks it, it gives the message "Goal," as you can see.

But, I don't want to distribute this screengui to everyplayer in the server, just a specific team.

For example, I have 3 teams in my place, Red, White, Blue, and I want this script to only give the Gui to Team Blue, does anybody know how?

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent



local imageButton = Instance.new("ImageButton")
imageButton.Parent = screenGui
imageButton.Position = UDim2.new(0,10,0,50) player, change this.
imageButton.Size = UDim2.new(0,140,0,50) 
imageButton.Image = "rbxassetid://282019419" 

local textLabel = Instance.new("TextLabel") 
textLabel.Parent = screenGui
textLabel.Position = UDim2.new(0,10,0,50)
textLabel.Size = UDim2.new(0,140,0,50)
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = BrickColor.White().Color 
textLabel.Text = "Goal" 
textLabel.Visible = true

local text = Instance.new("TextLabel")
text.Parent = screenGui
text.Position = UDim2.new(0,10,0,50)
text.Size = UDim2.new(0,140,0,50)
text.Text = "Final Descision" 
text.BackgroundTransparency = 1
text.Visible = false

imageButton.MouseButton1Click:connect(function() 
textLabel.Visible = false
	local m = Instance.new("Message")
	m.Parent = game.Workspace
	m.Text = "GOOOOOAAAAAAAAAAAAALLLLLLLLLLL!"
	wait(5)
	m:remove()
	
	text.Visible = true
	wait(2)
	text.Visible = false
	
	
	
	textLabel.Visible = true
	
end)


1 answer

✓ Accepted answer
--Make sure the script is a LocalScript, and write this at the start:

local AllowedTeam = "Bright red" --Or whatever teamcolor
if (game.Players.LocalPlayer.TeamColor ~= BrickColor.new(AllowedTeam)) then
	return
end

2 comments

0

At the start of my script or another one?

0

Start of that script.

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