Ok so, i have to make a script where only one team can press the spectate button, can anyone help?


local player = game.Players.LocalPlayer
local team = player.TeamColor

while wait() do
    if team == BrickColor.new("Fossil") then
         player.PlayerGui:WaitForChild("SpectateGui").Button.Visible = true
    else if team == BrickColor.new("Alder") then
        player.PlayerGui:WaitForChild("SpectateGui").Button.Visible = true
    end
end

3 comments

0

You realize that you're making the button visible for both teams, right? You have it set to true for both teams.

0

I'd also use player.Changed instead of while wait() do. It might help to reduce lag.

0

oof yeah bro, thnks