Jump to content
Sign in to follow this  
Karrr

How to Reference an Array/Object From Script A Into Script B?

Recommended Posts

So I have this script

createspikes.sqf

_spikenamepool = [spike1, spike2, spike3, spike4, spike5, spike6, spike7, spike8, spike9, spike10, spike11, spike12];

_spikes = "spikestrip";

_spike1 = _spikenamepool select 0;
_spike1 = _spikes createVehicle [0,0,0];
_spike1 attachTo [player,[0,1.5,0]];


demountstripadd = player addAction ["Place Spike Strip", "demountspikes.sqf"];

player removeAction beginstripadd;
beginstripadd = beginstripadd - 1;

demountspikes.sqf

detach spike1;

player removeAction demountstripadd;
demountstripadd = demountstripadd - 1;

It spawns in correctly and attaches to the player then when I execute demountspikes.sqf it does nothing, I've tried using the array _spike1 the actual object name and everything. Any help is appreciated

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  

×