Jump to content
Sign in to follow this  
combat-agent

Script from module vehicle init

Recommended Posts

Im tryin to run a script on all the ambient vehicles that spawn. I put this in the module, but it does not work for some reason.

BIS_silvie_mainscope setvariable ["vehicleInit",{_this setfuel random .1; _this setdammage random 1;[_this] exec "scripts/carinven.sqs"}];

heres the script im tryin to run

_X=_this select 0
_y=floor random 7
hint "inventory"
~5
clearweaponcargo _x
clearmagazinecargo _x

_z=0


#loop
?_z==_y:goto "lights"
_type=random 1
?_type >=.5:_tools=Tools
?_type <.5:_tools=Tools2

_rnd = floor random (count _tools);
_item = Tools select _rnd;
?_type==Tools:_x addweaponcargoglobal _item
?_type==Tools2:_x addmagazinecargoglobal _item
_z=_z+1
goto "loop"

#lights
lightlady moveindriver _x
lightlady action ["lightOn", _x];
exit

Where am i goin wrong. I put a hint in there, and the hint never even shows when I try to run the script.

Share this post


Link to post
Share on other sites

Its working for me. Exactly like you posted.

You have to go into a city/village and wait up to 30 seconds till some vehicles are spawned. I get a lot of hints then...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×