mabe I am typing it wrong, I tryed function loop2 but can't get my script to loop, tryed starting this function in room script and main script (the games main script)
I think I just need to enter the code correctly for function loop2 command, . . . . I think
loop2 function, can't get to loop
Wait, I think you're mixing up on(loop), room script, main script and functions.
Firstly, you have the main script which runs all the time, it doesn't matter which room you're in. You don't need a loop() command in the main script either, just put your command lines in there.
Then you have the room script. It is initiated automatically when the room is loaded, but it requires commands like on(enter) and on(loop).
And then there are functions. Those are independent scripts which are initiated on command and repeated by a specified number of times. They don't require any on(loop) stuff either.
So, your mistakes are:
- on(loop2) is not a function itself and is not supposed to be written in a function either
- on(loop2) belongs to room script, it doesn't work right if you put it into the main script
If you've put on(loop2) into the room script and it still doesn't work, you made a mistake in the script or you didn't start the room script at all (because the room is not loaded?)
Firstly, you have the main script which runs all the time, it doesn't matter which room you're in. You don't need a loop() command in the main script either, just put your command lines in there.
Then you have the room script. It is initiated automatically when the room is loaded, but it requires commands like on(enter) and on(loop).
And then there are functions. Those are independent scripts which are initiated on command and repeated by a specified number of times. They don't require any on(loop) stuff either.
So, your mistakes are:
- on(loop2) is not a function itself and is not supposed to be written in a function either
- on(loop2) belongs to room script, it doesn't work right if you put it into the main script
If you've put on(loop2) into the room script and it still doesn't work, you made a mistake in the script or you didn't start the room script at all (because the room is not loaded?)
so can I loop a script infinitly somehow as this is written about in manual
I thought this could be done with
function (sciptname;loop2)
etc
all I would like is to place a function command in main or room script so I don't have to put the code all in the room script or main script as everything then gets so hard to brows through as its all in on script file
I thought this could be done with
function (sciptname;loop2)
etc
all I would like is to place a function command in main or room script so I don't have to put the code all in the room script or main script as everything then gets so hard to brows through as its all in on script file