Jump to content
Sign in to follow this  
Eckhart

Removeallweapons after respawn.

Recommended Posts

So, I'm trying to get a unit to spawn without weapons, which was simple and works fine. However, after respawning, the default weapons of the class are produced.

I looked around for awhile and messed with it for an hour or two now and can't seem to figure out why this isn't working to both spawn the first time with no weapons (which works), and then respawn after death with no weapons (which doesn't work). It seems simple enough, and that it should be working, but isn't.

In the unit's init line in the editor is:

removeallweapons this; this addEventHandler ["respawn", {removeallweapons this}];

Why does my crappy newbie coding not work?

Share this post


Link to post
Share on other sites

The EH returns a array, not a single object:

removeallweapons this; this addEventHandler ["respawn", {removeallweapons (_this select 0)}];

This should have the desired effect.

Share this post


Link to post
Share on other sites
Myke;1812400']This should have the desired effect.

Works excellently. Thank you.

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
Sign in to follow this  

×