LightningStrikesX 0 Posted January 24, 2021 New at scripting, and this one has me pulling my hair out, so here's my dilemma: I want to only give the group leaders in my mission access to the map item, and have it so that when other players are near one of these leaders they can access the map, but make it so that when they leave the proximity of the leader, the map disappears again, to simulate the players going to the leader and looking at their map. Now I'm not sure which way to do this, whether I need to make a detection script using inArea or if I can attach triggers to the leaders that will do unitname removeweapon "itemmap" unitname addweapon "itemmap" I also saw the "leader" command on BI wiki, and was wondering if it could be used to automatically assign the units? Any help would be greatly appreciated! Share this post Link to post Share on other sites
Melody_Mike 127 Posted January 24, 2021 Heya @LightningStrikesX, welcome to the forums :). You may want to take a look at an existing mod that does this: Share this post Link to post Share on other sites
LightningStrikesX 0 Posted January 25, 2021 Thanks @Melody_Mike, this looks interesting and I may well end up using it if I don't have any luck, but I still want to know if it's possible to do this without relying on an ACE mod, and by scripting or clever use of triggers. Share this post Link to post Share on other sites
pierremgi 4739 Posted January 25, 2021 Sure, in initPlayerlocal.sqf : [] spawn { waitUntil {sleep 1; !isNull findDisplay 46}; findDisplay 46 displayAddEventHandler["KeyDown"," if ((_this #1) in actionKeys 'showMap' && player distance leader player <3) exitWith {if !('itemMap' in items player) then {player addWeapon 'itemMap'}; openMap [true,false]}; player removeWeapon 'itemMap'; "]; }; Share this post Link to post Share on other sites