How to teleport players onto parts of a model?
m = Instance.new("Message")
h = Instance.new("Hint")
m.Parent = game.Workspace
h.Parent = game.Workspace
while true do
01 | if game.Players.NumPlayers = = 1 then |
03 | m.Text = "Loading-Please wait." |
07 | Spawns = game.Workspace.Elevator.McSwagon:GetChildren() |
09 | Spawnz = game.Workspace.Illuminboti:GetChildren() |
11 | m.Text = "Teleporting to Elevator" |
15 | for i, v in pairs (game.Players:GetPlayers()) do |
19 | check = game.Workspace:FindFirstChild(name) |
23 | checkHumanoid = check:FindFirstChild( "Humanoid" ) |
27 | check:MoveTo(Spawns [ 1 ] .Position) |
38 | for i, v in pairs (game.Players:GetPlayers()) do |
42 | check:MoveTo(Spawnz [ 1 ] .Position) |
end
So the goal of this script is as follows: To teleport 10 different players onto 10 different parts, with each player landing on a different part. The script works fine as is, but the problem is that whenever the players are teleported they all spawn on one part, even though there are 10 parts in each McSwagon and Illuminboti (the models which house the 10 parts.) I'm sure it's an easy fix that I'm just not seeing so if you know what the solution is I would greatly appreciate it.