ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 28 Dec 2013 12:13 PM |
Made simple script to clone a basic npc out of replicatedstorage to somewhere near the node.
Basically it knows there is 0 spawns, but it refuses to clone TownsPerson
while wait() do local InModel = script.Parent:GetChildren() local Spawns = #InModel-1 local RanX = math.random(-10,10) local RanZ = math.random(-10,10) print(Spawns) if Spawns < 3 then local Spawn = Game.ReplicatedStorage.TownsPerson:clone() Spawn.Torso.CFrame = CFrame.new(script.Parent.Position+Vector3.new(RanX,5,RanZ)) end end |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 28 Dec 2013 12:13 PM |
oh you know what i need to set its parent
thanks |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 28 Dec 2013 12:14 PM |
| I was about to say you needed to parent it. |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 28 Dec 2013 12:16 PM |
| ok new problem why don't the random variables change every time? |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
| |
|
Alex4897
|
  |
| Joined: 06 Aug 2008 |
| Total Posts: 14517 |
|
|
| 28 Dec 2013 12:18 PM |
Because when it's getting a random number it's choosing -10 of them. Pretty sure it has to be (1, 10).
I am an eggspert in the eggcelent art of egg puns. |
|
|
| Report Abuse |
|
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
| |
|
ColdSmoke
|
  |
| Joined: 02 Jan 2012 |
| Total Posts: 5784 |
|
|
| 28 Dec 2013 01:09 PM |
nope
i changed -10 to 1 and they still all spawn at the same spot |
|
|
| Report Abuse |
|
|