|
| 17 Aug 2013 08:01 PM |
Output: Players.Player1.Backpack.Menu.Main:52: bad argument #1 to 'pairs' (table expected, got nil)
Also the function "rectangle" does exist in my script, i'm just confused on why it says my table is nil even though it's there.
Script: local menuOperations = { Menu1 = {["Main"] = DisplayMenu(player, Main1), ["Main2 Test"] = DisplayMenu(player, Vision1)}, }
function DisplayMenu(player_1, Menu) local pos = 0 for i,v in pairs(Menu) do rectangle(player_1, v, Color3.new(163, 162, 165), 1, Color3.new(163, 162, 165), UDim2.new(0, 0, 0, pos), UDim2.new(0, 500, 0, 25), Enum.FontSize.Size14, v, Color3.new(255, 255, 255)) pos = pos + 25 end end
DisplayMenu(player, menuOperations.Menu1) -- player exists as well. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 17 Aug 2013 08:05 PM |
| Is Main1 and Vision1 defined? |
|
|
| Report Abuse |
|
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 17 Aug 2013 08:07 PM |
| And they are both tables, correct? |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Aug 2013 08:09 PM |
| Try removing that comaa since nothing comes after it |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 08:10 PM |
| I would try removing that comma on line two just for the halibut. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Aug 2013 08:12 PM |
| The comma has nothing to do with it. The script functions perfectly until the for loop. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 17 Aug 2013 08:13 PM |
Well, I don't see any other errors. Blame John. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 17 Aug 2013 08:14 PM |
| @cnt, the output is at the top of my post... |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Aug 2013 08:15 PM |
So the second argument of rectangle is a function? "DisplayMenu(player, Main1)" is being ran |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Aug 2013 08:16 PM |
Hmm weird, I read it wrong QQ
|
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 08:22 PM |
| For loops and tables always get me. They error like crazy. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 17 Aug 2013 08:26 PM |
Can you remove that comma anyway? My OCD is burning. |
|
|
| Report Abuse |
|
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 17 Aug 2013 08:31 PM |
| @express... did you.. read the... script? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
| |
|
Maileh
|
  |
| Joined: 14 Jun 2011 |
| Total Posts: 1067 |
|
|
| 17 Aug 2013 08:38 PM |
for _,v in pairs(Main) do post if workd k |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Aug 2013 08:39 PM |
| ^ just get out, that will not fix it. |
|
|
| Report Abuse |
|
|