Jump to content
Sign in to follow this  
Lala14

Using the new actions (attachedto)

Recommended Posts

alright so I want to use the new attachedto command to delete objects off a vehicle rather than name due to them being spawned through scripts causing them only to delete the latest one

and another thing is i am trying to use this for a vehicle ir strobe (feel free to use)

this addaction ["<t color='#FF0000'>Vehicle IR Strobe On</t>", {strobe = "NVG_TargetC" createVehicle getPos (_this select 0); strobe attachTo [(_this select 0),[0,-2,0.5]]},"",1,true,true,"",'isNil "strobe"']; 
this addaction ["<t color='#FF0000'>Vehicle IR Strobe Off</t>", {deleteVehicle strobe},"",1,true,true,"",'alive strobe']; 
this addaction ["<t color='#FF0000'>Vehicle IR Strobe On</t>", {strobe = "NVG_TargetC" createVehicle getPos (_this select 0); strobe attachTo [(_this select 0),[0,-2,0.5]]},"",1,true,true,"",'!alive strobe'];

this is how it is right now but im just wondering if I could change it to instead use the new attachedto command

Share this post


Link to post
Share on other sites

Yes but my point is that I want to try to utilise the attached to command to instead of doing !alive strobe or isNull Strobe to instead check if the vehicle has something attachedto it and also to later on delete it! so like deleteVehicle (attachedto (_this select 0)) idk

Share this post


Link to post
Share on other sites

Well everything you need to know is here:

https://community.bistudio.com/wiki/attachedTo

This is what I use to delete a strobe light that's attached to a floodlight which is attached to a popup target.

_target addEventHandler ["Hit", {_obj1 = attachedobjects (_this select 0) select 0; _obj2 = attachedobjects _obj1 select 0; deletevehicle _obj2;}];

_obj2 refers to the strobe #lightpoint and is used by the deletevehicle command.

Working flawless. What's keeping you from using it?

Cheers

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  

×