Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't my character spawning?

Asked by 11 years ago
1if plr.TeamColor == "Bright blue" then
2        plr.Character.Torso.CFrame = CFrame.new(205, 17.4, -74.8)
3elseif plr.TeamColor == "Bright red" then
4    plr.Character.Torso.CFrame = CFrame.new(-362.4, 17.4, 78.2)
5end

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?

2 answers

Log in to vote
1
Answered by 11 years ago

First, make sure that 'plr' is defined.

Second, you're comparing the TeamColor to a string. Here's how you should do it:

1if plr.TeamColor == BrickColor.new("Bright blue") then
2        plr.Character.Torso.CFrame = CFrame.new(205, 17.4, -74.8)
3elseif plr.TeamColor == BrickColor.new("Bright red") then
4    plr.Character.Torso.CFrame = CFrame.new(-362.4, 17.4, 78.2)
5end
0
plr is defined, but thanks. lowvillan 10 — 11y
Ad
Log in to vote
0
Answered by
Hybric 271 Moderation Voter
11 years ago
1if plr.TeamColor == BrickColor.new("Bright blue") then
2    plr.Character:MoveTo(Vector3.new(205,17.4, -74.8))
3elseif plr.TeamColor == BrickColor.new("Bright red") then
4    plr.Character:MoveTo(Vector3.new(-362.4, 17.4, 78.4))
5end

Answer this question