Forum Jump :

Author Message

Posts: 4

Level: Member

Country: uk
In-game name:

#183695 Posted at 2015-11-02 20:43        
I just gave your example a try 654wak654 but I'm having a bit of trouble.

# 654wak654 :
You don't have to name any units in the editor, there are tons of other ways to refer to the group leader.
//Picked the first player from the list of all players.
_unit = allPlayers select 0;

//The group leader of that player has to be the leader we're looking for.
_leader = leader _unit;
//Because this is really small a COOP mission, there's only a single group with players.

//Now you can use "_leader" anywhere for chat
_leader groupChat "Let's roll out!";

Where am I meant to type these lines?

I put the first two in the init.sqf in the mission folder to tell the game at launch that *THIS* guy is the group leader. The third line I put in the 'on trigger activation' window of a placed trigger when any member of group is present within its radius. The trigger keeps throwing a tantrum and tells me that there is a "Local variable in Global space".
Am I simply typing this in the wrong place or do I need to change it somehow to become a global command?

Tags: Group, Scripting, Talk