Jump to content

Recommended Posts

Hello, guys!

Could someone please tell me what is wrong with this script? It doesn't work and I have no idea what could be wrong. It's a script to be used on a dedicated server, I'm running it via initServer.
Any help will be greatly appreciated.
Thanks.

sleep 5;

 if (side _x == WEST) then   
  { 
   { 
   removeVest _x; 
   removeBackpack _x; 
   removeHeadgear _x; 
   _x addVest "rhs_6sh92"; 
   _x addHeadgear "rhsgref_helmet_pasgt_erdl"; 
   _x unlinkItem "ItemRadio";  
   _x Skill 0.65; 
   }forEach allUnits; 
  }; 

 

Share this post


Link to post
Share on other sites
if (side _x == WEST) then 

_x is undefined at that point so that's where it fails. Did you mean to put that if inside the foreach loop instead?

Share this post


Link to post
Share on other sites

Put the forEach loop and the side check down one each:

sleep 5;

{
	if (side _x == WEST) then { 
		removeVest _x; 
		removeBackpack _x; 
		removeHeadgear _x; 
		_x addVest "rhs_6sh92"; 
		_x addHeadgear "rhsgref_helmet_pasgt_erdl"; 
		_x unlinkItem "ItemRadio";  
		_x Skill 0.65; 
	}; 
}forEach allUnits; 

 

Share this post


Link to post
Share on other sites
{
  removeVest _x;
  removeBackpack _x;
  removeHeadgear _x;
  _x addVest "rhs_6sh92";
  _x addHeadgear "rhsgref_helmet_pasgt_erdl";
  _x unlinkItem "ItemRadio";
  _x setSkill 0.65
}forEach (allUnits select {side _x == WEST})

 

  • Like 5

Share this post


Link to post
Share on other sites

Thanks a lot, guys! Much appreciated. 👍

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×