olli_ 13 Posted October 11, 2014 I want to store the amount of ammo i have so i can remove and replace the ammo at will. The problem is that the script doesnt run all the time, its called by an eventhandler every once in a while. Im having trouble figuring out how to preserve the ammo amount variable over multiple runs of the sqf. I thought about using a global variable but that would mean its global for ALL instances of my vehicle, and that wouldnt work. Share this post Link to post Share on other sites
lappihuan 178 Posted October 12, 2014 Global just means everywhere on the Machine it was created, as example your PC. What do you mean with ALL instances of my vehicle? In case the variables are bound to a vehicle just setVariable the variable to the vehicle and later get it with getVariable. Share this post Link to post Share on other sites
olli_ 13 Posted October 14, 2014 ooh yes that might be exactly what im looking for. Thanks. My problem was i was trying to save certain states to a single vehicle that could be accessed by the same script over multiple runs. whenever the script ended it would wipe all local variables, so that was no good, and using global variables would mean it would be global, so if i had 2 vehicles for example, it would be the same for both so that was no good either. This should fix that though :) Share this post Link to post Share on other sites