need help understanding functions with javascript

Just for example I have a simple function like

function doSomething(amt : int) : int
{
//do stuff
return 10;
}

but I would like to make it a function any of my scripts can access.

How would I go about doing that?

I want to create a set of functions that I can access from all my scripts. They would simple be sending variables and returning a number.

You could make a script, and make all the variables and functions public static in it, but I dont know if this approach would cause problems.

I will give that a try.

Thank you

Use the same idea for functions and for variables, so if you need variables from one script to pass to another one, just declare them static. Same for functions as said before by roi. Good luck!

thank you for your input :slight_smile: