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

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

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago
--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
0
At the start of my script or another one? Laserpenguin12 85 — 8y
0
Start of that script. darkelementallord 686 — 8y
Ad

Answer this question