I'm trying to make a script where if you die you team will be changed.
Okay. You'll use the humanoid's died function.
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Died
This'll be coupled with a simple change of the team, with something similar to player.Team = team
.
http://wiki.roblox.com/index.php?title=API:Class/Player/Team