Need help with equation of enemy hit

Hello,

how can I make it possible to display the hit I make on an enemy?
I want it to be shown everytime I hit the enemy so it spawns above like "-10" .. "-12" etc etc.

Whats the equation?

check picture for setup at the moment.
I tried health - player damage but that only show the health that is left.

regards

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    When hit change X to random (A,B)

    Display X

    Change self.health to self.health-X

  • KIIVIINKIIVIIN Member Posts: 159

    @Socks said:
    When hit change X to random (A,B)

    Display X

    Change self.health to self.health-X

    I tried that but issue is that instead of showing every hit I do it sum up on X.

    So for the first hit which should be between 2-12 its lets say -10 on display. Next hit is lets say 9 it show -19.. then next -25 etc etc until its equal to the health of enemy in negative state.

    What I need is that it show the hit in negative state every hit.
    I cannot figure it out :&

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2016

    @KIIVIIN said:
    I tried that but issue is that instead of showing every hit I do it sum up on X.

    You've probably made a mistake in the way your rules are set up - the example I gave you will work, it will display only the last chosen random value.

    Can you upload a screenshot of the rules you have used.

  • KIIVIINKIIVIIN Member Posts: 159

    @Socks said:

    @KIIVIIN said:
    I tried that but issue is that instead of showing every hit I do it sum up on X.

    You've probably made a mistake in the way your rules are set up - the example I gave you will work, it will display only the last chosen random value.

    Can you upload a screenshot of the rules you have used.

    I think I made it to work! I just added : "-"..
    to the display text so its like its negative numbers.

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2016

    @KIIVIIN said:

    Your code is different to my suggestion, that's why it doesn't work ! :)

    My version says:

    When hit change X to random (A,B)

    Your version says:

    When hit change X to X-random (A,B)

  • KIIVIINKIIVIIN Member Posts: 159

    @Socks said:

    @KIIVIIN said:

    Your code is different to my suggestion, that's why it doesn't work ! :)

    My version says:

    When hit change X to random (A,B)

    Your version says:

    When hit change X to X-random (A,B)

    Thank you!

Sign In or Register to comment.