Jump to content

Cancel event running even when the expression is false


Nd_

Recommended Posts

So I have a Kit on my server which allows you to leap. The problem is that it will cause fall damage, so I added this skript.

on damage:
      damage was caused by fall:
            if {%victim's uuid%.leaping} is true:
                  set {%victim's uuid%.leaping} to false
                  cancel event
            else:
                  if {%victim's uuid%.leaping} is true:
                        set {%victim's uuid%.leaping} to false   

The problem is that it cancels the event even when the event is false. There are no errors.

Link to comment
Share on other sites

On 8/18/2019 at 1:30 PM, Nd_ said:

So I have a Kit on my server which allows you to leap. The problem is that it will cause fall damage, so I added this skript.


on damage:
      damage was caused by fall:
            if {%victim's uuid%.leaping} is true:
                  set {%victim's uuid%.leaping} to false
                  cancel event
            else:
                  if {%victim's uuid%.leaping} is true:
                        set {%victim's uuid%.leaping} to false   

The problem is that it cancels the event even when the event is false. There are no errors.

I forgot who said it but you don't want to have a selector at the beginning of a variable. No idea if it affects anything though, just give it a shot.

image.png.fc5cd86d55d6b191eb015e7ea2901d69.png

image.png.ec85a3c75900cb8be1a4274a7852fb4d.png 

image.png.690ec77894511793a39ea74c345a1683.png

image.png.8ea30351b8aff3d00d791ed28b01b7d5.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...