|
| 16 Feb 2014 02:16 PM |
Q5. Knowing the way functions work, is it possible to make a script full of functions, and access them individually in different scripts?
Q6. Was answering that annoying
A1. Yes I know I started at 5, if you read my last thread you'd know why |
|
|
| Report Abuse |
|
|
kinglan
|
  |
| Joined: 25 Mar 2010 |
| Total Posts: 420 |
|
|
| 16 Feb 2014 02:57 PM |
| You can have as many functios as long as there in the flow of the script. |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2014 03:16 PM |
So if I made a script like
function kill(play) game.Players.play:Destroy() end
I can do this in another script
kill(warspyking)
??? |
|
|
| Report Abuse |
|
|
Gorake
|
  |
| Joined: 10 Feb 2014 |
| Total Posts: 219 |
|
|
| 16 Feb 2014 03:18 PM |
Well, no, at least not like that.
The simplest way to do it for you would be to use global functions, which CAN be accessed across-the-board by all scripts. You create them by putting _G. in front of the function name:
function _G.kill(player) game.Players[player].Character:BreakJoints() end
Then in another
_G.kill("warspyking")
There are other ways to do it as well, using modulescripts and remotebinded function, but this is the easiest. |
|
|
| Report Abuse |
|
|