|
| 28 Jan 2015 10:24 PM |
----- rawPA = game:GetService("HttpService"):GetAsync("http://pastebin.com/raw.php?i=pHWq2pYQ") listPA = {} for i in string.gmatch(rawPA,"%d+") do table.insert(listPA, i) end
if inTable(listPA, tostring(player.userId)) then wait() player:Kick() end ----- >bad argument #1 to 'pairs' (table expected, got nil)
?? |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 28 Jan 2015 10:26 PM |
| I don't even see a pairs operator in your post. Is this the right code snippet? |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2015 10:28 PM |
There is an 'inTable' function defined earlier in the script. It is perfectly functional and is not the source of the issue. |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 28 Jan 2015 10:36 PM |
| Well you have a grumpy pairs operator somewhere and it isn't in this snippet. Are you sure these are the lines causing the problem? |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2015 10:41 PM |
The error is on this specific line: -- if inTable(listPA, tostring(player.userId)) then --
The inTable function is as follows, though it is not causing the error.
----- function inTable(tble, str, dictionary) if dictionary == true then for i,v in pairs(tble) do if str == i then return i end end else for i,v in pairs(tble) do if str == v then return v end end end end ----- |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 28 Jan 2015 11:49 PM |
With what you gave us everything seems fine since listPA 'is' a table no matter what. It seems that tble is nil, which shouldn't be possible.
Try adding a print(listPA) before calling the inTable function and a print(tble) inside. Or of course just put the full script on pastebin. |
|
|
| Report Abuse |
|
|
|
| 29 Jan 2015 06:48 PM |
Found the issue. listPA and rawPA were defined within a co routine containing an endless loop. I accidentally put them in there while I was working fast at adding cool new features. (: |
|
|
| Report Abuse |
|
|