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: Is anyone else having problems with table related functions?

Previous Thread :: Next Thread 
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
03 Mar 2012 11:13 AM
I was just testing tables and I got this in output:

t = {1, 2, 3, 4, 5} print(t[1] .. " " .. t[2] .. " " .. t[:1: attempt to call field 'remove' (a nil value)

Full command:

t = {1, 2, 3, 4, 5} print(t[1] .. " " .. t[2] .. " " .. t[3] .. " " .. t[4] .. " " .. t[5]) table.remove(t, 4) print(t[1] .. " " .. t[2] .. " " .. t[3] .. " " .. t[4] .. " " .. t[5])

table.concat wouldn't work either...
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
03 Mar 2012 11:45 AM
Have you defined table as a variable in that script?
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
03 Mar 2012 12:32 PM
No - and you don't need to.
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
03 Mar 2012 12:33 PM
I didn't say that you would need to..
That would be a thing which causes that :P
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
03 Mar 2012 12:35 PM
Add the following to the top of your script:
local table_backup = table

Then replace all occurances of `table.` with `table_backup.`.

~+[CROOKITY BANDED SNAKES]+~
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
03 Mar 2012 12:36 PM
>Add the following to the top of your script:
>local table_backup = table
>Then replace all occurances of table. with table_backup..


It's a haaaax! :3
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
03 Mar 2012 12:43 PM
I'm not an idiot.
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
03 Mar 2012 12:45 PM
Who says you are an idiot
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
03 Mar 2012 12:46 PM
*Points finger to su*

Grapje...grapje :D
(Jokes.....jokes)
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
03 Mar 2012 12:48 PM
It's rude to point a human with finger..
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
03 Mar 2012 12:51 PM
I figured out how much all the stuff I was buying would cost - the things were priced on their weight, and there's a 15% tax - and got it correct within 2 cents.
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
03 Mar 2012 12:57 PM
@su: But pointers also point and they always betray my shelter when playing hide'n'seek. ;-;

@com: wat
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
03 Mar 2012 01:49 PM
Basically I can do pretty advanced math in my head in a matter of seconds.
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
03 Mar 2012 02:02 PM
As well as pointing, pointers cause horrific memory leaks
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
03 Mar 2012 02:36 PM
"Basically I can do pretty advanced math in my head in a matter of seconds."


We learned how to do that in 6th grade ._.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
03 Mar 2012 02:39 PM
t = {1, 2, 3, 4, 5}
print(tostring(t[1]) .. " " ..tostring(t[2]).. " " ..tostring(t[3]).. " "..tostring(t[4]).. " "..tostring(t[5]))
table.remove(t, 4)
print(tostring(t[1]) .. " " ..tostring(t[2]).. " " ..tostring(t[3]).. " "..tostring(t[4]).. " "..tostring(t[5]))


If you use tostring() if it's nil it won't break. :P
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
03 Mar 2012 03:06 PM
I don't do math in my head, I don't see the use when I have computers, calculators, and whiteboards. If I need to do something and I don't have a computer, calculator or whiteboard I take out my notebook and do the calculations. (Pocket-sized notebooks, yay!)

~+[CROOKITY BANDED SNAKES]+~
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
03 Mar 2012 04:17 PM
That's ridiculious popin.
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
03 Mar 2012 06:05 PM
"That's ridiculious popin."

Name one scenario in real life other than a test you'll ever _NEED_ to do mental calculations and not have access to a calculator or pen

Mmmm?
Report Abuse
Flurite is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
03 Mar 2012 06:20 PM
@trapping,

Hmm.. you have gotten very annoying over the months you were away. That's probably the reason why my mind was at peace, these past few months..

Anyway, I think doing 10*5 in your head is a lot easier than doing it on paper if you were calculating the cost of 10 $5 posters at a store.

~Flurite
Report Abuse
jon456456 is not online. jon456456
Joined: 07 Aug 2009
Total Posts: 483
03 Mar 2012 06:21 PM
nope
Report Abuse
Flurite is not online. Flurite
Joined: 03 Apr 2011
Total Posts: 5386
03 Mar 2012 06:21 PM
Oh, and since you emphasize "need", give me one reason why you NEED to use pen and paper instead of doing it all in your head.

~Flurite
Report Abuse
Legend26 is not online. Legend26
Joined: 08 Sep 2008
Total Posts: 10586
03 Mar 2012 06:28 PM
table.remove removes the fourth index and sets the fourth index to the fifth. Therefore, in your second print statement, it's trying to do this: (1 .. 2 .. 3 .. 5 .. nil) which it can't do because you can't use the ".." operator with nil.
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
04 Mar 2012 02:18 AM
Mental arithmetic is a lot more useful for most people than, say, algebra.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
04 Mar 2012 03:02 AM
@poppin

You are hanging on a cliff, a bear stole your pants, and you don't know how much force/arc you need to get a rope over the top/around a tree, and you have 1 chance.

Drawing:

       \\    //
        \\  //
         | // -- Tree. :P
         | /
         ||
         || -- Rope needs to go around here.
         ||
         ||
------------
              |
              |
              |
              |
              \ -- You are here w/ rope
               |
               |
               |
               | --The bear/pants are somewhere below here.
               | --(With pen, calculator, and pocket notebook
               |
               |
               |
               |
               |
               |
               |
               | -- Your calculator is around here
               |
               |
               |
               |
               |
               | -- Your math teacher and white board are here.
               |
               |
               \
                |
                |
                |^^^^^^^^^ -- Spikey rocks are here.
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