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: Global Functions

Previous Thread :: Next Thread 
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:16 PM
How do I set one up, and how do I call one?
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
03 Jan 2014 02:18 PM
add _G. before the function

_G.function asd()
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:18 PM
That's not correct, please make sure you know what your doing before you post stuff.
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
03 Jan 2014 02:21 PM
the g thing goes behind the name, not function, srry
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:22 PM
Nope...
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
03 Jan 2014 02:22 PM
function _G.Hi()
print("Hi")
end
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2014 02:23 PM
_G.GlobalFunctionsAreBroken = (function()
print("Not 100% true")
end)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jan 2014 02:25 PM
_G.theFunction = function(theParameter)
print(theParameter)
end

_G.theFunction("theArgument")
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:26 PM
@Not, what is ("theArgument")?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
03 Jan 2014 02:29 PM
The argument I provided.

function thisIsAFunction(thisIsAParameter)

end

thisIsAFunction(thisIsAnArgument)
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:29 PM
I know that, but how do I use it?
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2014 02:30 PM
He just introduced arguments for no reason...

It's just a way of 'Sharing' information to a function..


function SpecialPrint( This )
print("Special",This)
end

SpecialPrint("HELLO WORLD!")

Output > Special HELLO WORLD!
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2014 02:31 PM
http://wiki.roblox.com/index.php/Arguments_and_parameters
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Jan 2014 02:33 PM
It's just an argument madness.

function lol(hello)
print(hello, "is the given poop")
end

lol("xD")


And if you are a lazy person who doesn't want to find and replace all his functions
_G.lol=lol
yay
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:36 PM
Players.Player1.PlayerGui.VoteGui.Script:154: attempt to call field 'LoadGame1' (a nil value)

I got an output :O
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:37 PM
This is were it says the error is


_G.LoadGame1("")
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Jan 2014 02:37 PM
What scripts did you use...
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2014 02:37 PM
_G.LoadGame1("") --Is nil
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Jan 2014 02:38 PM
Late post.

Where did you define the function. And they have to be the same type of script.
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:38 PM
What do I do to make it not nil? And cnt, do you have a flood check?
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:39 PM
They are the same type of script,

This is the function

_G.LoadGame1 = function()
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Jan 2014 02:39 PM
Post the definition and make sure the scripts are the same type.
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2014 02:39 PM
Define the function.
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
03 Jan 2014 02:39 PM
LAte post again... :(

Please tell me you put an end on that function right?
Report Abuse
person725 is not online. person725
Joined: 11 Oct 2009
Total Posts: 535
03 Jan 2014 02:40 PM
@not, yes.
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