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: Problem with tables

Previous Thread :: Next Thread 
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
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 is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
17 Aug 2013 08:05 PM
Is Main1 and Vision1 defined?
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
17 Aug 2013 08:06 PM
Yes.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
17 Aug 2013 08:07 PM
And they are both tables, correct?
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
17 Aug 2013 08:08 PM
Yup.
Report Abuse
cntkillme is not online. 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
SeaEmperor is not online. SeaEmperor
Joined: 15 Aug 2013
Total Posts: 168
17 Aug 2013 08:10 PM
I would try removing that comma on line two just for the halibut.
Report Abuse
SeaEmperor is not online. SeaEmperor
Joined: 15 Aug 2013
Total Posts: 168
17 Aug 2013 08:11 PM
cnt u sneaky dog
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Aug 2013 08:12 PM
llelelelele
Report Abuse
ZachBloxx is not online. 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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Aug 2013 08:14 PM
Any output?
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
17 Aug 2013 08:14 PM
@cnt, the output is at the top of my post...
Report Abuse
cntkillme is not online. 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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Aug 2013 08:16 PM
Hmm weird, I read it wrong QQ
Report Abuse
DangCoolIsReal is not online. DangCoolIsReal
Joined: 03 Jun 2013
Total Posts: 4110
17 Aug 2013 08:22 PM
For loops and tables always get me. They error like crazy.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Aug 2013 08:23 PM
It seems fine...
Report Abuse
SeaEmperor is not online. SeaEmperor
Joined: 15 Aug 2013
Total Posts: 168
17 Aug 2013 08:26 PM
Can you remove that comma anyway?
My OCD is burning.
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
17 Aug 2013 08:30 PM
Is menu defined?
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
17 Aug 2013 08:31 PM
@express... did you.. read the... script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Aug 2013 08:32 PM
NO REALLY
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
17 Aug 2013 08:32 PM
Facepalm*
Report Abuse
Maileh is not online. 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 is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
17 Aug 2013 08:39 PM
-facepalm-
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Aug 2013 08:39 PM
^ just get out, that will not fix it.
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