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 » Scripting Helpers
Home Search
 

Re: ... Why won't this work?

Previous Thread :: Next Thread 
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
25 Aug 2011 08:07 PM
table.insert(parts,wp[i],wp[i].Name)

that's not all just one part. If you want the whole script then just ask.
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
25 Aug 2011 08:09 PM
Output:


Thu Aug 25 21:04:29 2011 - Workspace.Script:11: bad argument #2 to 'insert' (number expected, got userdata)
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
25 Aug 2011 08:14 PM
Here's the whole script:



local parts = {}
local models = {}
local modelc
local partc
local check = 0.25
local waitTime = 0.5
while wait(check) do
wp = game.Workspace:GetChildren()
for i = 1,#wp do
if wp[i].ClassName == "Part" then
table.insert(parts,wp[i],wp[i].Name)
partc = partc + 1
wait(waitTime)
end
end
print(unpack(parts))
wm = game.Workspace:GetChildren()
for i = 1,#wm do
if wm[i].ClassName == "Model" then
table.insert(models,wm[i],wm[i].Name)
modelc = modelc + 1
wait(waitTime)
end
end
print(unpack(parts))
print(modelc)
print(partc)
wait(waitTime)
end
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
25 Aug 2011 09:27 PM
Are you trying to insert a value into a table with the keys an object value?

rawset(parts,wp[i],wp[i].Name)
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
26 Aug 2011 08:18 PM
No, trying to make as many table spaces as there are in part wise, and the name of them is the name of the parts. Same with the models.
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
26 Aug 2011 09:07 PM
instead of table.insert, do what I posted 2above
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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