|
| 05 Sep 2014 10:59 PM |
like for example, if you do something simple like
function random() game.Workspace.BasePlate.Transparency = 0.5 end
And then in the next script you could right like
game.Workspace.Script.random()
What do we write to make a function run if you want to do it in another script to run it, can we? (I am new to scripting) |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 11:02 PM |
bump
i really need help on this |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Sep 2014 11:33 PM |
yes
global functions
1st script--
_G["printf"] = function(text) -- creates the global function print(text) end
2nd script --
_G["printf"]("Hello World!") -- runs a global function
|
|
|
| Report Abuse |
|
|
|
| 06 Sep 2014 12:18 AM |
Yes,
shared.function ExampleName (ExampleArgument) example code end
You can do this with variables as well shared. means any scrip can access it
BUT YOU ALWAYS HAVE TO PUT .shared BEFORE EVEN WHEN ACCESSING IT NOT JUST DECLARING |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2014 01:16 AM |
| y u no bindable/remote functions u n00bs. |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Sep 2014 10:58 AM |
| didn't work, give me an example of the next code that runs the function. |
|
|
| Report Abuse |
|
|