code:
local teams = game:GetService("Teams"):GetTeams()
local teams = game:GetService("Teams"):GetTeams()
local function touched (hit)
local playing = game.Teams.Playing
print(#playing)
if #playing:GetPlayers() == 0 then
for _, player in pairs(game.Players:GetPlayers()) do
player.TeamColor = BrickColor.new('Navy blue')
player.Character.Head:Destroy()
print('k')
end
end
end
script.Parent.Touched:Connect(touched)
error:
Workspace.s.Script:6: attempt to get length of local 'playing' (a userdata value)
the purpose for this script is when you hit a brick then it will restart the match if there are no players on the playing team.

5 comments
game.Teams.Playing doesnt return a table
doing #playing:GetPlayers() makes no sense
^ yes it does wdym
i dont think :GetPlayers() is a function of a table
You just said it yourself, game.Teams.Playing doesn't return a table | So if he does game.Teams.Playing:GetPlayers(), where is the function on the table? | GetPlayers() is a Teams function | Review the API a little more, not to be rude