Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Won't work? - supposed to teleport you on respawn if you're on blue or red team

game.Players.PlayerAdded:connect(function (plr) plr.CharacterAdded:connect(function (char) wait(.5) if plr.TeamColor=="Bright blue" then char.Torso.CFrame=game.Workspace.BTeamPart.CFrame+CFrame.new(math.random(1,9), 0, math.random(1,9)) elseif plr.TeamColor=="Bright red" then char.Torso.CFrame=game.Workspace.RTeamPart.CFrame+CFrame.new(math.random(1,9), 0, math.random(1,9)) end end) end)


I opened the dev console and there are no errors for this.

1 comment

0

A CFrame is a 3 part position, you only added 2 parts. 0,0,0 not 0,0

1 answer

✓ Accepted answer

The issue with what you're doing is the fact that you're attempting to check whether a BrickColor (the player's TeamColor) is a equal to a particular string - It never will be.

The following changes to the if statements should fix the issue.

if plr.TeamColor == BrickColor.new("Bright blue") then
if plr.TeamColor == BrickColor.new("Bright red") then

It should be noted, however, that if you're using a SpawnLocation (which is associated with a team) they will already be transported to their respective spawns when they, well, spawn.

This discussion is preserved as it was. New answers, comments, and votes are closed.