OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Lollypop on 21 May 2009, 18:45:35

Title: Script error but works fine in trigger
Post by: Lollypop on 21 May 2009, 18:45:35
Hello

I copied some code from a trigger that opens gates when someone gets into trigger area.
But its not working properly: it opens and closes the gate 1st time with an error message "Invalid number in expression" in line 8"

If i try again to open them it stays open..doesnt close again.

can anyone help pls?

i attached the sqf file.
Title: Re: Script error but works fine in trigger
Post by: i0n0s on 21 May 2009, 18:55:24
~ doesn't work in SQF, use sleep instead.
Title: Re: Script error but works fine in trigger
Post by: Lollypop on 21 May 2009, 19:17:21
hai..tnx for the reply..

im such a noob...the gates already have a built in open/close you just have to get near them  ::)

however for future use..the solution you gave me produced another error a missing ; in line 9  any ideas? :dunno:
Title: Re: Script error but works fine in trigger
Post by: i0n0s on 21 May 2009, 20:17:59
Each command in SQF has to be determinated with an ;
So you need to add ; to the end of each command.
I can recommend to read the Basic SQF Tutorial (http://www.ofpec.com/ed_depot/index.php?action=details&id=390&game=ArmA)
Title: Re: Script error but works fine in trigger
Post by: hoz on 22 May 2009, 22:27:05
The error is like on the line above the ~5  in sqf has to be replaced with sleep 5;