So look, in my obby, I already used the 4 colored spawns ROBLOX made for us. Then I had to make my own spawns, by cloning one of them, and putting a script in it so you change teams when you touch one of my custom spawns.
But the problem is with my custom spawns. If you die, you don't spawn on the custom spawns, you just spawn in the middle of nowhere.
That is why I created this script:
game.Players.PlayerAdded:connect(function(plr)
plr.Character.Humanoid.Died:connect(function(died)
if plr.TeamColor == BrickColor.new("New Yeller") then
wait(6)
died.Parent:MoveTo(game.Workspace.Custom1.Position)
elseif plr.TeamColor == BrickColor.new("Toothpaste") then
wait(6)
died.Parent:MoveTo(game.Workspace.SpecialSpawn2.Position)
elseif plr.TeamColor == BrickColor.new("Pink") then
wait(6)
died.Parent:MoveTo(game.Workspace.Custom3.Position)
else
print("The player that died isn't on any of the custom spawn teams, so they weren't teleported")
end
end)
end)
It has an error. In output, it is saying this: 11:38:21.241 - Workspace.Script:2: attempt to index field 'Character' (a nil value) Help?

1 comment
You can still use Roblox's spawn system. There's tons of brickcolors, so just edit the TeamColor property of each spawn accordingly.