LordWiII
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 411 |
|
|
| 02 Aug 2013 12:23 PM |
Call a local function from another script that is the child of the script that has the local function.
example:
game.Workspace.Script.OtherScript
if I called a local function in "Script" in "OtherScript" would it work?
I'm a newbie scripter. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:24 PM |
It would if you made it a global function, but no, local functions wont work in seperate scripts.
|
|
|
| Report Abuse |
|
|
LordWiII
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 411 |
|
|
| 02 Aug 2013 12:25 PM |
| So if I put "global" before the function I'm using would it work? |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:27 PM |
no.... http://wiki.roblox.com/index.php/Global_Functions
If that doesn't help you,
_G.AFunctionName = function() print("testtest") end
you can call _G.AFunctionName() in any other script |
|
|
| Report Abuse |
|
|
LordWiII
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 411 |
|
|
| 02 Aug 2013 12:33 PM |
Ok, global scripting sounds interesting. Thanks for the help.
|
|
|
| Report Abuse |
|
|