on MyFunctionName (myFirstParam,mySecondParam,etc..)
--code goes here
return MyReturnValue--this line is only neede if you want to return a value
end MyFunctionName
to call the function use:
MyFunctionName (myFirstParam,mySecondParam,etc..)
if there is no return value, or
MyVariable = MyFunctionName (myFirstParam,mySecondParam,etc..)
to set myVariable to the return value.
You will automatically return to the calling script.
Create the function in either the script that calles it or in a movie script.
If you create the function in a movie script then you can call it from any script. If you write the function in a behaviour then it can only be called from within the same behaviour script.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.