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

Why isn't my character spawning?

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

✓ Accepted answer

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

1 comment

0

plr is defined, but thanks.

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

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