generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Weapon spawns

Previous Thread :: Next Thread 
peIicans is not online. 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 is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Jun 2016 11:00 PM
and newspawn value is true


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Jun 2016 11:02 PM
b1


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Jun 2016 11:25 PM
b2


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Jun 2016 11:44 PM
b3


Report Abuse
peIicans is not online. peIicans
Joined: 02 Nov 2013
Total Posts: 1148
16 Jun 2016 11:50 PM
b4


Report Abuse
Internecivus is not online. Internecivus
Joined: 31 May 2011
Total Posts: 2784
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 is not online. 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
Internecivus is not online. Internecivus
Joined: 31 May 2011
Total Posts: 2784
16 Jun 2016 11:57 PM
Yes, something like that.
Report Abuse
peIicans is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image