|
| 13 Jun 2014 04:06 PM |
How could this be more efficient? How could the scripts all clone into a different brick no matter what?
Script1 = Game.Lighting.Scripts.Script1:Clone() Script2 = Game.Lighting.Scripts.Script2:Clone() Script3 = Game.Lighting.Scripts.Script3:Clone() Script4 = Game.Lighting.Scripts.Script4:Clone() Script5 = Game.Lighting.Scripts.Script5:Clone() local Children = Game.Workspace.Parts:GetChildren() Script1.Parent = Children[math.random(1, #Children)] Script2.Parent = Children[math.random(1, #Children)] Script3.Parent = Children[math.random(1, #Children)] Script4.Parent = Children[math.random(1, #Children)] Script5.Parent = Children[math.random(1, #Children)] |
|
|
| Report Abuse |
|
|
solarDEV
|
  |
| Joined: 23 May 2014 |
| Total Posts: 1767 |
|
|
| 13 Jun 2014 04:07 PM |
| What is the need to clone all that stuff from lightning? |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jun 2014 04:16 PM |
| No one can make this more efficient? |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 04:18 PM |
for i = 1,5 do Clone = game.Lighting.Scripts["Script" .. i ]:Clone() Clone.Parent = Game.Workspace.Parts:GetChildren()[math.random(#Children)] end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 04:31 PM |
local parts = Game.Workspace.Parts:GetChildren();
for key = 1, 5 do local randomScript = game.Lighting.Scripts["Script" .. key]:Clone(); randomScript.Parent = table.remove(parts, math.random(#parts)); end
So no 2 will be together |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 04:33 PM |
| Why are you using Lighting? You should move your scripts to ServerStorage and pull them from there. |
|
|
| Report Abuse |
|
|