I am trying to make a spectate Gui that spectates everyone except the “Lobby” team.
I have made a spectate script but it spectates everyone, including the Lobby team.
Pointers or tips would be appreciated.
2 Likes
Just add a check:
if player.Team ~= team.Lobby then --team is the TeamService
-- spectate
end
1 Like
No I mean, I want it to spectate everyone except people who are on the lobby team; so pressing the arrows will switch between people who arent on the lobby team
So just loop through all the player, use a check to decide whether to add a player into a table or not, and then only let player spectate the player who’s in the table.
One thing you can do is just use Team:GetPlayers()
on both teams and then just merge both of them into just one big table.
local Teams = game:GetService("Teams")
local Red = Teams:WaitForChild("Red")
local Blue Teams:WaitForChild("Blue")
local gamePlayers
gamePlayers = Red:GetPlayers()
for i,v in pairs(Blue:GetPlayers()) do
table.insert(gamePlayers,v)
end
4 Likes