I am making a training center for my game. There will be 3 teams, Trainee (white) Staff (Medium blue) and host (black). I want the host to have a button that nobody else can access. Here is my script:
local Players = game:GetService("Players").LocalPlayer if Players.Teams.TeamColor == (Players.Teams.TeamColor == "Black") then game.StarterGui.ScreenGui.TextButton.Visible = true else game.StarterGui.ScreenGui.TextButton.Visible = false end
I just figured out an easier way, it is visible to everyone but only the certain team can use it. Here is the script if anyone else needs it.
local frame = script.Parent.Parent.Frame local open = false local others = game.Teams.Trainee local others = game.Teams.Staff local Person = game.Players.LocalPlayer local Main = game.Teams.Host frame.Visible = false script.Parent.MouseButton1Click:Connect(function() if Person.Team == Main then frame.Visible = true elseif Person.Team == others then frame.Visible = false script.Parent.Text = "Not right team." wait(1) script.Parent.Text = "Open Host Gui" end end)