iceman77 18 Posted April 9, 2008 Iam trying to get my carbomb script working..It is supposed to 1).Detect if the unit is in the vehicle. 2).detect if the speed of the car is greater than five. 3).blow up if both conditions are met.. the unit gets in the car and it blows up instantly...obviously the syntax is messed up or something... it gives me a "generic error in expression" error  Quote[/b] ]?(_unit in _vehicle) and (|#|_vehicle speed >5):goto.... here is the script below..any help would be appreciated. _unit = _this select 0 _vehicle = _this select 1 #update ?(_unit in _vehicle) and (_vehicle speed >5):goto "bomb" ~2 :goto "update" #bomb ~5 _vehicle setdammage 1 _unit setdammage 1 exit Regards Iceman Share this post Link to post Share on other sites
blackgrain 0 Posted April 9, 2008 mmm... seems problem of "speed" command: http://community.bistudio.com/wiki/speed Your parameter is first.. and must be after the command Try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?((_unit in _vehicle) && ( speed _vehicle >5)): goto "bomb"; And think about convert and use SQF in your scripts ... Share this post Link to post Share on other sites
dachevs 1 Posted April 9, 2008 GoTo doesn't work in SQF though. You don't need the : before the GoTo "update" Share this post Link to post Share on other sites
lebson506th 0 Posted April 9, 2008 I thought you did... Share this post Link to post Share on other sites
iceman77 18 Posted April 9, 2008 thanks guys..it works now..Dachevs is correct..you don't need the : before the goto "update" command...iam assuming that the goto command after the : will only activate if a certain condition is met  i.e. : goto "blowup"  when the unit is in the vehicle and the vehicle is going over the speed of 5 we want the script to keep checking if the unit is in the vehicle and is going over speed of 5 therefore no need for the : Iam a noob scripter trying to learn...please correct anything i've said in this post if it's incorrect.. Regards,  Iceman Share this post Link to post Share on other sites
iceman77 18 Posted April 10, 2008 Here's a similar script to the one i've posted above...exept i want the vehicle explode when the units inside the vehicle and the vehicles engine is on.. iam getting another generic error in expression Quote[/b] ]?(_unit in _vehicle)and(|#|engineon _vehicle):goto... _unit = _this select 0 _vehicle = _this select 1 #update ?(_unit in _vehicle)and(engineon _vehicle):goto "blowup" ~2 goto "update" #blowup _vehicle setdammage 1 _unit setdamage 1 ~3 player sidechat "Took care of that punk!" exit Regards, Iceman Share this post Link to post Share on other sites
blackgrain 0 Posted April 10, 2008 To DaChevs: Quote[/b] ]GoTo doesn't work in SQF though. Yes... excuse my bad english... i never said that that code was sqf... i said "think about convert.." Quote[/b] ]You don't need the : before the GoTo "update" You are right!! I didn´t see the ":" To Texas*BDA*: Quote[/b] ]?(_unit in _vehicle)and(|#|engineon _vehicle):goto... May be the problem is engineon command... try isEngineOn http://community.bistudio.com/wiki/isEngineOn <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?((_unit in _vehicle) and (isEngineOn _vehicle)) : goto... Share this post Link to post Share on other sites
iceman77 18 Posted April 13, 2008 Thanks Blackgrain!! Regards, Iceman Share this post Link to post Share on other sites
dachevs 1 Posted April 14, 2008 No problem blackgrain. @TexasBDA As for the : , I believe this is only needed when you are using it for a unit, just as you said Like ?(Unit1 == player) : GoTo "blank". Good luck Hope you get your scripts workin. Share this post Link to post Share on other sites