Jordan Booth 2 Posted June 10, 2019 I am trying to make it so that in game i can spawn an Ifrit with shift + i and it works however when i hold down the keys it spawn loads of Ifrits all around the player. How do i make it so that it only spawns one per key press? This is what i am using at the moment: Thanks in advance. keyhandler.sqf: KeyFunctions = [ [[35, true, false, false], "weaponholster.sqf"], [[23, true, false, false], "ifritspawn.sqf"], [[35, false, true, false], "weaponunholster.sqf"]]; while {isNull(findDisplay 46)} do {sleep 0}; (findDisplay 46) displayAddEventHandler ["KeyDown", { private _kpd = _this select [1, 4]; {_x params ["_key", "_scr"]; if (_key isEqualTo _kpd) exitWith {execVM _scr; true}; false; } forEach KeyFunctions; }]; ifritspawn.sqf: _veh = "O_MRAP_02_F" createVehicle(position player); Share this post Link to post Share on other sites
gc8 970 Posted June 10, 2019 Look keyup instead than keydown 1 1 Share this post Link to post Share on other sites
Jordan Booth 2 Posted June 10, 2019 Thanks. That works. Share this post Link to post Share on other sites