So I want to make it so that if you are a certain team, then you will automatically go to one of four spawn points. Here is the script I have for this:
if game.Players.LocalPlayer.TeamColor == "Really Red" then
KnightSpawnPoint = math.random(4)
if KnightSpawnPoint == 1 then
game.Players.LocalPlayer.Character.MoveTo(447, 105.225, 299.22)
elseif KnightSpawnPoint == 2 then
game.Players.LocalPlayer.Character.MoveTo(312.7, 105.225, 303.22)
elseif KnightSpawnPoint == 3 then
game.Players.LocalPlayer.Character.MoveTo(315.7, 108.713, 432.77)
elseif game.Players.LocalPlayer.TeamColor == "Really Red" and KnightSpawnPoint == 4 then
game.Players.LocalPlayer.Character.MoveTo(446.775, 108.713, 432.77)
end
end
I have this script (not local script) in the workspace and no errors come up, but it wont work? Can you please explain what I did wrong?

1 comment
So, what do you mean by --Put your code here? Are you saying all the code, because if so that didn't work. Are you talking about some parts of the code? I don't know what to put inside that?