1 | if plr.TeamColor = = "Bright blue" then |
2 | plr.Character.Torso.CFrame = CFrame.new( 205 , 17.4 , - 74.8 ) |
3 | elseif plr.TeamColor = = "Bright red" then |
4 | plr.Character.Torso.CFrame = CFrame.new(- 362.4 , 17.4 , 78.2 ) |
5 | end |
It runs it just fine, no errors, but it doesn't teleport the player in the map, but it thinks it has. How do i fix this?
First, make sure that 'plr' is defined.
Second, you're comparing the TeamColor to a string. Here's how you should do it:
1 | if plr.TeamColor = = BrickColor.new( "Bright blue" ) then |
2 | plr.Character.Torso.CFrame = CFrame.new( 205 , 17.4 , - 74.8 ) |
3 | elseif plr.TeamColor = = BrickColor.new( "Bright red" ) then |
4 | plr.Character.Torso.CFrame = CFrame.new(- 362.4 , 17.4 , 78.2 ) |
5 | end |
1 | if plr.TeamColor = = BrickColor.new( "Bright blue" ) then |
2 | plr.Character:MoveTo(Vector 3. new( 205 , 17.4 , - 74.8 )) |
3 | elseif plr.TeamColor = = BrickColor.new( "Bright red" ) then |
4 | plr.Character:MoveTo(Vector 3. new(- 362.4 , 17.4 , 78.4 )) |
5 | end |