Jump to content
Sign in to follow this  
soldier2390@hotmail.com

How to Spawn and Delete Functions from Trigger Init's?

Recommended Posts

I was wondering how one could go about using a Trigger to Spawn a Function once a player enters a Trigger's area. Then delete the Function once the player leaves the Trigger? While having that process repeatable.

 

So far I have tried using the Trigger's Activation field to call the Function (BIS_fnc_Crows), and then the Trigger's Deativation field to delete that Function.

 

However that's where my problem is. As everything I have tired..including searching the internet and using script commands such as deleteVehicle and other similar commands has all failed! I know it's possible as I have done similar things in the past but it dont help that I have not scripted anything since early A2 days, and A3 is seemingly more complex.

Share this post


Link to post
Share on other sites

@soldier2390@hotmail.com, you can't delete finally compiled functions. But you can delete objects (crows) created by function:

{deleteVehicle _x;} forEach bis_crows;

Share this post


Link to post
Share on other sites

@Schatten Ah right...now that you mentioned that it brought back memories. Plus that makes sense as awhile ago I tried to use a Trigger to Spawn a Trigger, that once spawned would activate a script that I wrote. And that script called functions that once I deleted the Trigger still remained running/and or caused errors!

 

Thanks very much for your response, I'm sure I will be back with more questions. But for the moment you fixed my current problem.

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  

×