I want certain things to happen when a player from a certain team dies. For example, I want music to play but my code is not working. Could someone help me/offer me some pointers or let me know if my syntax is wrong? Thanks!
while true do wait()
local boss = game.Players:GetChildren()
if boss.TeamColor == 'Bright red' then
if boss.Character:findFirstChild("Head") ~= nil then --Checks if the physical player exists
boss.Character:WaitForChild("Humanoid").Died:connect(function()
print(boss.Name.."has died!")
game.Workspace.Music:Play()
end)
end
end
end

1 comment
I need this only for players of a certain team, I tried something like this but it does not work http://pastebin.com/RZbePsxE