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: Adding a value to a table?

Previous Thread :: Next Thread 
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
06 May 2012 09:13 AM
How would I go about adding the name of a part to a table?

site.Players.callmeduck2.PostCount.Value=site.Players.callmeduck2.PostCount.Value+1
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
06 May 2012 09:16 AM
table.insert(tableName, Placment, Information)
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
06 May 2012 09:19 AM
Confused.. I have an existing table that I want to add to
table.Insert(Parts, hit.Parent.Name, ???)

site.Players.callmeduck2.PostCount.Value=site.Players.callmeduck2.PostCount.Value+1
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
06 May 2012 09:21 AM
table.insert(tableName, Placment, Information)


Table name being the name of the table you want to insert information to,

Placement would be the position the data would be entered into the table

information would be the information you are putting into the table.


so,

table.Insert(Parts, 1, hit.Parent.Name)

print(Parts[1])
>What ever 'hit.Parent.Name' would be.
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
06 May 2012 09:26 AM
now Idk how many parts will end up going into the table and I just want it to keep adding them.. How can I do that without defining a 'Placement' #?

site.Players.callmeduck2.PostCount.Value=site.Players.callmeduck2.PostCount.Value+1
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
06 May 2012 09:27 AM
for the placement number just do

#Parts + 1


It will just put it one in front of how many objects there are in the table.
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
06 May 2012 09:30 AM
I see. Thanks :D

site.Players.callmeduck2.PostCount.Value=site.Players.callmeduck2.PostCount.Value+1
Report Abuse
callmeduck2 is not online. callmeduck2
Joined: 18 Jan 2010
Total Posts: 2804
06 May 2012 09:36 AM
One last thing, How can I set the table value as a String value? So I can Use it between scripts?

site.Players.callmeduck2.PostCount.Value=site.Players.callmeduck2.PostCount.Value+1
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
06 May 2012 03:43 PM
as in the data entered in the table is a string?

in the example of adding a name it's all ready a string.
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