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
 

Getting length of _G Table

Previous Thread :: Next Thread 
PiggyJingles is not online. PiggyJingles
Joined: 13 Jan 2009
Total Posts: 2472
02 Feb 2014 05:46 AM
Is there a way to do this using #?
I tried:

#_G[questgiver.Name.."Dialog"]
and
_G[#(questgiver.Name.."Dialog")]

But it gives nil.
So I'm not sure how you could do this unless you used a loop.
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
02 Feb 2014 05:54 AM
Are you sure that the table exists when you attempt to print/whatever its length?

_G.HeyDialog = {1, 2, 3}

questgiver = "Hey"
print(#_G[questgiver.."Dialog"]) --> 3
Report Abuse
PiggyJingles is not online. PiggyJingles
Joined: 13 Jan 2009
Total Posts: 2472
02 Feb 2014 06:04 AM
Could it be that the script the _G[questgiver.."Dialog"] is in is server-side, while the one I'm calling it with is local?
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
02 Feb 2014 06:56 AM
Yes, that would be the issue. Client-side scripts and server-side scripts have separate global tables.

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