peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
|
| 16 Jun 2016 10:59 PM |
im trying to spawn weapons into the workspace on to spawn pads it doesnt print "cloned" so before that is the error i dont know how to fix
newspawn = workspace["new spawn"] weapons = game.ServerStorage:GetChildren() spawns = workspace.WeaponSpawns:GetChildren()
if newspawn == true then wait(2) weaponsC = weapons:Clone() weaponsC.Parent = workspace print("cloned") for i,v in pairs(weaponsC:GetChildren()) do v:MoveTo(spawns[i].Position) print("moved") end end
|
|
|
| Report Abuse |
|
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
|
| 16 Jun 2016 11:00 PM |
and newspawn value is true
|
|
|
| Report Abuse |
|
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
| |
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
| |
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
| |
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
| |
|
|
| 16 Jun 2016 11:51 PM |
| GetChildren returns a table, you can't clone an entire table. Instead you need to use a for loop to iterate through it like you did in the bottom half of your code. |
|
|
| Report Abuse |
|
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
|
| 16 Jun 2016 11:55 PM |
wait so like
for i,v in pairs(game.ServerStorage:GetChildren()) v:Clone() v:MoveTo(spawns[i].Position) end
|
|
|
| Report Abuse |
|
|
| |
|
peIicans
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 1148 |
|
|
| 17 Jun 2016 12:07 AM |
i came up with this but how do you move a tool moving part dont work
newspawn = workspace["new spawn"] weapons = game.ServerStorage:GetChildren() spawns = workspace.WeaponSpawns:GetChildren()
newspawn.Changed:connect(function() wait(2) for i,v in pairs(game.ServerStorage:GetChildren()) do v:Clone() print("Cloned") v.Parent = workspace print("parented") v:MoveTo(spawns[i].Position) print("Moved") end end)
|
|
|
| Report Abuse |
|
|