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
 

Global Functions Help

Previous Thread :: Next Thread 
jetlogan is not online. jetlogan
Joined: 05 May 2010
Total Posts: 1423
24 Nov 2013 01:04 PM
function check()
return "ready"
end

_G.Screen = {check = function() check() end}

print(_G.Screen.check())

I haven't played around with this in a long time, no excuse me if this is the a simple question, but how come it isn't print anything and giving me no errors?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
24 Nov 2013 01:08 PM
Because you are defining check and calling it within a local scope of the global scope, it turns out check() just recursively calls itself. Name the local function 'check' outside of the table something else.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Nov 2013 01:08 PM
return check()
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
24 Nov 2013 01:09 PM
^That, as well.
Report Abuse
jetlogan is not online. jetlogan
Joined: 05 May 2010
Total Posts: 1423
24 Nov 2013 01:11 PM
@Ab I did your thing and it still didn't work.
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
24 Nov 2013 01:12 PM
Do what cnt said, also.
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
24 Nov 2013 01:12 PM
Like so:

local check0 = function()
return 'ready'
end

_G.Screen = {check = function() return check0() end}

print(_G.Screen.check())
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