So look, since my title is kind of confusing, so I will explain it to you.
When someone joins, they spawn on a colored spawn (at least in my obby, its colored, along with its own team). I want to make it so when someone joins, they will become blue team WITHOUT their character touching any other colored spawn.
I tried this by doing a script so when they join, I used :BreakJoints() on them, and then changed their teamcolor to blue. Then I realized that their limbs will touch the colored spawn, thus changing them to a different team before they respawn from death (Unless they are lucky and spawn with blue in the first place)
Help me out?
A player has a property named "TeamColor". You can change the TeamColor. TeamColors use BrickColor value. So for example:
game:GetService("Players").LordDragonZord.TeamColor = BrickColor.new(1) game:GetService("Players").LordDragonZord.TeamColor = BrickColor.new("White") game:GetService("Players").LordDragonZord.TeamColor = BrickColor.white() --All of these work.
Start off with a team color script
To make someone start off like this we need to use the PlayerAdded event function.
game:GetService("Players").PlayerAdded:connect(function(plyr) plyr.TeamColor = BrickColor.Blue() --Blue end)
Custom "spawn"
Now to make the spawn. Since you can touch and change teams with regular spawns after death, make a part a normal part that LOOKS like a spawn and insert this script.
script.Parent.Touched:connect(function(limb) local h = limb.Parent:FindFirstChild("Humanoid") local plyr = game:GetService("Players"):GetPlayerFromCharacter(limb.Parent) if h and plyr and h.Health < 0 then plyr.TeamColor = script.Parent.BrickColor --or plyr.TeamColor = BrickColor.new("White") or something... end end
Hope this helps!
P.S. Here is the site where you can get the brick color codes and names. Do not use colors whose names are crossed out. That means the colors are bugged.