How to make armour hurt player once when worn?

Started by Spyjetray on Wed, 07/03/2019 - 08:58

Topic category: Bugs and solutions

Last seen on 12:46, 23. Jul 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How to make armour hurt player once when worn?
Wed, 07/03/2019 - 08:58

So for my mod, I need the chest piece of armour to hurt the player when they put it on but only once when wearing it but it hurts them each time they equip it.

https://imgur.com/a/QnxlM5d

This is the code I have so far but it does not work.

I have tried a global world variable to turn on and off the part that deals damage but it does not work.

Can someone tell me where I have gone wrong?

Thanks.

Last seen on 19:10, 22. Aug 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
Trigger this procedure using…
Wed, 07/03/2019 - 10:15

Trigger this procedure using global player tick trigger. If you trigger this using armor tick event, your variable will not be reset once the player takes the armor down as once the armor is no on the player, this procedure won't be called anymore.

Last seen on 12:46, 23. Jul 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
It worked perfectly, thanks!
Wed, 07/03/2019 - 13:10

It worked perfectly, thanks!

Last seen on 19:10, 22. Aug 2019
Joined Apr 2010
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
  • developer
You are welcome!
Wed, 07/03/2019 - 13:44

You are welcome!