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
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 03 Jan 2014 02:18 PM |
add _G. before the function
_G.function asd()
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 535 |
|
| |
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 03 Jan 2014 02:22 PM |
function _G.Hi() print("Hi") end |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2014 02:23 PM |
_G.GlobalFunctionsAreBroken = (function() print("Not 100% true") end) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2014 02:25 PM |
_G.theFunction = function(theParameter) print(theParameter) end
_G.theFunction("theArgument") |
|
|
| Report Abuse |
|
|
person725
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 535 |
|
|
| 03 Jan 2014 02:26 PM |
| @Not, what is ("theArgument")? |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2014 02:29 PM |
The argument I provided.
function thisIsAFunction(thisIsAParameter)
end
thisIsAFunction(thisIsAnArgument) |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 03 Jan 2014 02:31 PM |
| http://wiki.roblox.com/index.php/Arguments_and_parameters |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 03 Jan 2014 02:37 PM |
| What scripts did you use... |
|
|
| Report Abuse |
|
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 03 Jan 2014 02:39 PM |
| Post the definition and make sure the scripts are the same type. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jan 2014 02:39 PM |
LAte post again... :(
Please tell me you put an end on that function right? |
|
|
| Report Abuse |
|
|
person725
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 535 |
|
| |
|