OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 07 Sep 2014 06:05 PM |
Why is this? I have quite a few differnt math.random scripts and like every single time the same result happens, but it's math.random.
local num=math.random(1,#spawns:GetChildren()) local place = spawns:GetChildren()[num] player.Character.Torso.CFrame=place.CFrame
this being one, it always has the same result for the first time. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2014 06:28 PM |
| Probably becuase #spawns:GetChlidren() == 1, maybe. |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2014 06:32 PM |
local num = spawns:GetChildren() rand = num[math.random(#num)] local place = spawns:GetChildren()[num] player.Character.Torso.CFrame=place.CFrame
|
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 07 Sep 2014 06:48 PM |
Place = (spawns:GetChildren()[math.random(1,#spawns:GetChildren())])
player.Character.Torso.CFrame = CFrame.new(game.Workspace:FindFirstChild(tostring(Place)).Position + Vector3.new(0,5,0)) |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 07 Sep 2014 06:49 PM |
| For mine make sure the spawns are named differently. |
|
|
| Report Abuse |
|
|