EMAN381
|
  |
| Joined: 27 Nov 2007 |
| Total Posts: 4300 |
|
|
| 18 Jun 2012 12:53 PM |
By read, I mean actually understand what they mean. Is there any place where you can find a list of output errors and understand what they mean?
For example, "bad argument #1 to 'pairs' (table expected, got userdata)"
I do not understand that at all. All I would know to something like that is that there is something in the code of "for i,v in pairs()". Argument is something that has two variables seperated by a comma, and I do not understand what "#1" means, or what they meant in parentheses. |
|
|
| Report Abuse |
|
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
| |
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 18 Jun 2012 12:56 PM |
| The argument in the pairs() function was not a table, but userdata (obviously) |
|
|
| Report Abuse |
|
|
EMAN381
|
  |
| Joined: 27 Nov 2007 |
| Total Posts: 4300 |
|
|
| 18 Jun 2012 12:59 PM |
| So, the table would be something like Get()ing children, and when it displays userdata, it means that the argument just said objects and nothing about Get()ing basically? |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Jun 2012 01:07 PM |
| #1 is which argument you gave the wrong type to. |
|
|
| Report Abuse |
|
|
EMAN381
|
  |
| Joined: 27 Nov 2007 |
| Total Posts: 4300 |
|
|
| 18 Jun 2012 01:09 PM |
| So #1 would be the 'i' in 'for i,v in pairs()'? |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 18 Jun 2012 01:12 PM |
>bad argument #1 to 'pairs' (table expected, got userdata)
Means you're calling function table with userdata, and you're supposed to call it with a table. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:15 PM |
| #1 would be the argument you're giving to pairs. Pairs is a function. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 18 Jun 2012 01:18 PM |
Means you're calling function with userdata, and you're supposed to call it with a table.*
I don't even know why I had 'table' after le function :O |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 18 Jun 2012 01:20 PM |
It means:
bad argument #1 to 'pairs' (table expected, got userdata) --- For real, just try dissecting it. So you have the function pairs(), and it says "bad argument #1". If you think about it, the first argument pairs() received, was not what it wanted. In the parenthesis, it says "table expected, got userdata". That means, in the first argument, it was bad because you put a userdata in instead of a table. That means, you should put a table into the first argument of pairs. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 01:22 PM |
ugh so much fail
When you do
for _,v in pairs(x) do
Pairs is an iterating function.
#1 means number 1. Did you never learn that or are you just not even bothering to think for yourself?
Argument is to simplify, something you pass to a function, which again you should know.
So bad argument #1 means something is wrong with the first argument. So since pairs() you've only given one argument, the comment is something like "expected table got userdata"
Well that should be obvious too. It wanted a table ({}) to iterate through and you gave it a userdata.
It's honestly not in the least bit complicated. |
|
|
| Report Abuse |
|
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 18 Jun 2012 01:26 PM |
@trappingnoobs: Exactly why I said "use your brain" earlier.
If you're using pairs you should know what it does, so the error should be obvious. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 18 Jun 2012 01:33 PM |
@trapping 'n dats bassically wat i sad hurrdurr |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 18 Jun 2012 01:34 PM |
| said* i should rly pay attention on speling tings |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 02:25 PM |
| I've been wondering the same thing |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 02:29 PM |
There's a wiki article called "Lua Errors". I don't want to post the URL, because the last time I posted the URL of a wiki article, I got banned. :c
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 02:40 PM |
> last time I posted the URL of a wiki article, I got banned. :c
WAT!
http://wiki.roblox.com/index.php/Errors
do i get the ban hammer now |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 06:12 PM |
@dark - Dunno. All I know is that after it happened, I PM'ed Sorcus and never got a reply. :c
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook |
|
|
| Report Abuse |
|
|
8SunTzu8
|
  |
| Joined: 30 Sep 2011 |
| Total Posts: 8199 |
|
|
| 18 Jun 2012 06:42 PM |
"attempt to call a nil value"
"Disconnect because of exception."
Or something like that. It did not tell me where the nil value was, and everything is checked in my script, and no values were nil, as far as I know.
My character does exist...
"APN Forever, Long Live Its Eternal Glory!" |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2012 07:10 PM |
'attempt to call a nil value' without any stack trace is from
event:connect(nil)
Good luck finding it, mostly likely you mistyped the name of the function. |
|
|
| Report Abuse |
|
|
8SunTzu8
|
  |
| Joined: 30 Sep 2011 |
| Total Posts: 8199 |
|
|
| 18 Jun 2012 09:47 PM |
I've looked for typos, there were none. :/
It's connected to a touched event...
Touched:connect(Teleporting)
function Teleporting(hit)
:/ I know it is in the first few lines of the script, since none of the prints in the function appear.
"APN Forever, Long Live Its Eternal Glory!" |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2012 09:53 AM |
sun, that's an extremely obvious mistake
pretty much identical to this:
x = x + 1
x = 5
if you can't spot your mistake you should relearn how to script |
|
|
| Report Abuse |
|
|
badcc
|
  |
| Joined: 18 Jan 2009 |
| Total Posts: 3170 |
|
|
| 19 Jun 2012 10:05 AM |
| You'll learn. They are very helpful. |
|
|
| Report Abuse |
|
|
8SunTzu8
|
  |
| Joined: 30 Sep 2011 |
| Total Posts: 8199 |
|
|
| 19 Jun 2012 11:12 AM |
It's nothing that obvious, I can assure you...
I've reread the script a few times, and re-coded many parts. I'll probably just start from scratch.
"APN Forever, Long Live Its Eternal Glory!" |
|
|
| Report Abuse |
|
|