code:
local teams = game:GetService("Teams"):GetTeams()
local playerss = game.Teams
local function touched (hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if #playerss.Playing:GetPlayers() ~= 0 then
for i, v in pairs(game.Teams["Specating"]:GetPlayers()) do
v.TeamColor = BrickColor.new('Navy blue') -- Change it with the color you set the team with(ex. BrickColor.new("Really Black")
v.Character.Head:Destroy()
print('k')
end
end
end
script.Parent.Touched:Connect(touched)
When you touch this brick it is supposed to run the code in the if statements but the player doesn't die, the teams don't change, and it wont even print 'k'.
Edit: somebody pointed out my code had a wrong team name. I fixed it but it still doesn't work.

5 comments
I put a print just before the if and it did print when I touched the brick so it runs but there is an issue.
try changing #playerss.Playing:GetPlayers() to #(game.Players:GetPlayers())
Did you misspell "Spectating"? Is that why it isn't working? (1-Up?)
Is the team name "Spectating" and not "Specating"?
/\ no its not it. I misspelled it in the team in the team folder in the explorer as well cause i was tired.