pazuzu 21 Posted August 9, 2023 Hello. I'm trying to set up a way to spawn a Greyhawk on my server. I've added an object (phonebooth) with the addaction: this addAction["<t color='#ff9900'>Create Drone</t>", "drone.sqf"]; This is the drone script: myUAV = createVehicle ["B_UAV_02_F", getPos player, [], 0,"FLY"]; createVehicleCrew myUAV; Now this works fine but what I want to do is limit the amount of drone spawns or have a timer player has to wait for before spawning another drone. How would I do this? Thank you. Share this post Link to post Share on other sites
_foley 192 Posted August 10, 2023 This will require player to wait at least 60s between spawning drones. if (!isNil "myUavLastSpawned" && {myUavLastSpawned > time - 60}) exitWith { hint "Try again later"; }; myUavLastSpawned = time; myUAV = createVehicle ["B_UAV_02_F", getPos player, [], 0,"FLY"]; createVehicleCrew myUAV; 2 Share this post Link to post Share on other sites
pazuzu 21 Posted August 10, 2023 7 hours ago, _foley said: This will require player to wait at least 60s between spawning drones. if (!isNil "myUavLastSpawned" && {myUavLastSpawned > time - 60}) exitWith { hint "Try again later"; }; myUavLastSpawned = time; myUAV = createVehicle ["B_UAV_02_F", getPos player, [], 0,"FLY"]; createVehicleCrew myUAV; This is perfect. Thank you very much. Share this post Link to post Share on other sites