spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 27 May 2016 08:37 PM |
It just doesnt teleport the player. Anyone know why?
local MapPositions = script["Map Positions"] local Players = game.Players:GetPlayers() local MapStats = script["Game Setup"] local Map = MapStats.Map local GameMode = MapStats["Game Mode"] local MapModels = game.Lighting.Maps local Maps = { "Castle" } local GameModes = { "Free For All" }
while true do -- Choosing Map and Mode -- Map.Value = Maps[math.random(1,#Maps)] GameMode.Value = GameModes[math.random(1,#GameModes)] -- Cloning Map -- wait(3) MapModels[Map.Value]:Clone().Parent = game.Workspace -- Game Setup -- if Map.Value == Maps[1] then if GameMode.Value == GameModes[1] then local Spawns = MapPositions[Map.Value][GameMode.Value]["Spawn 1"] for i = 1,#Players do Players[i].Character.Torso.CFrame = CFrame.new(Spawns) end end end
repeat wait() until game.Workspace == nil
end
|
|
|
| Report Abuse |
|
|
|
| 27 May 2016 08:38 PM |
Players[i].Character.Torso.CFrame = CFrame.new(Spawns.Position)?
|
|
|
| Report Abuse |
|
|
doctor152
|
  |
| Joined: 30 Nov 2008 |
| Total Posts: 308 |
|
|
| 27 May 2016 08:39 PM |
Players[i].Character.Torso.CFrame = CFrame.new(Spawns.Position)?
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 27 May 2016 08:39 PM |
No. The spawns are vector 3 values.
|
|
|
| Report Abuse |
|
|
|
| 27 May 2016 08:40 PM |
You set the variable 'Players' once at beginning of the script. So it contains the players who were in game at that point in time. But if players enter afterwards, they wont be automatically added to the table. So you have to get the players every time, just before you loop over them. Then it will get all the players. |
|
|
| Report Abuse |
|
|
|
| 27 May 2016 08:40 PM |
My brain cells just perished.
Just use parts m8/8+7
|
|
|
| Report Abuse |
|
|
|
| 27 May 2016 08:41 PM |
| Oh and you need to read .Value of the chosen spawn to pass to the CFrame constructor, otherwise youre just passing the Vector3Value object itself? |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 27 May 2016 08:42 PM |
I fixed that but i dont understand what you first stated
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
| |
|