Jump to content
bertram

removeAllWeapons not working in script

Recommended Posts

I have a "onPlayerRespawn.sqf" running in my mission, however every command works just fine except removeAllWeapons.

 

player addEventHandler ["Respawn",
{
	removeAllWeapons (_this select 0);
	removeAllAssignedItems (_this select 0);
	removebackpack (_this select 0);
	removeVest (_this select 0);
	removeUniform (_this select 0);
	removeHeadGear (_this select 0);
	removeGoggles (_this select 0);
	(_this select 0) setVariable ["HG_myCash",600];
}];

If I just use the removeAllWeapons command it will work once then fail on every subsequent respawn where each other command works 100% of the time.

Share this post


Link to post
Share on other sites

You have to choose between the script "onPlayerRespawn.sqf" and the Event Handler "Respawn".

It's useless and counterproductive to use both!

Share this post


Link to post
Share on other sites

I get the same results if I choose one or the other.

 

Edit: I made a work around for just removing weapons from the player when the enter a trigger which works for what I'm doing. 

Edited by bertram

Share this post


Link to post
Share on other sites

Just one thing: That doesn't occur in Vanilla. Everything goes well. So, you have a mod (or a script) which is weird on respawn.

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

×