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 10 years ago
if plr.TeamColor == "Bright blue" then
        plr.Character.Torso.CFrame = CFrame.new(205, 17.4, -74.8)
elseif plr.TeamColor == "Bright red" then
    plr.Character.Torso.CFrame = CFrame.new(-362.4, 17.4, 78.2)
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?

2 answers

Log in to vote
1
Answered by 10 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:

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

Answer this question