I am trying to make a collision function. It should check the x coordinates of both objects/characters and then return a value if it's true.
But the problem is that I cannot make a new function. I even tried to
make simple ones like just displaying messages but they just do not work.
in global script:
function dice();{
Display ("It's a nice dice");
}
when character interacts with tree
dice();
I get this message:
Error(line 23): undefined token 'dice'
HELP
You have to add 'import dice();' in the script header.
also with this line:
function dice();{
you need to leave out the semi colon ie ";"
so the line looks like this:
function dice(){
so it works in all the scripts, do what Barcik says
but if you create a function in the global script, you can call it from the global script without importing it in the script header.
same in a room script
...but don't forget this function word when importing.
Example:
global script:
function dice() {
Display ("It's a nice dice");
}
script header:
import function dice();
-Cheers
right, sorry, my mistake