Edit: Nevermind I just added a CharacterAdded function and it worked
I have a script that reduces a number value once a user dies. It worked fine until I tried to add a line of code that would also change their team once they died. Now the script doesn't seem to be working at all. Here's what it looks like:
game.Players.PlayerAdded:Connect(function(p) wait(1) p.Character.Humanoid.Died:Connect(function() if p.Team ~= game.Teams.Choosing then p.Team = game.Teams.Choosing game.ServerScriptService.CoreScripts.CoreValues.PlayersLeft.Value = game.ServerScriptService.CoreScripts.CoreValues.PlayersLeft.Value - 1 end end) end)