Jump to content

Skript lines using "is" are annoying


Pancake123

Recommended Posts

I have two things im working on and both have the same issue "Skript cant compare "thing" to "thing". I don't understand why this happens. I use almost the same code for other things and it works but for these it doesn't. There's isn't enough info on google so please help. How do I solve this

The code if you want it:

on consume of honey bottle:
    name of item-event is "&o&aGlue Bottle":
        effect player with nausea 

The other code:

on damage:
    attacker is a zombie named "&4Damaging Zombie":
        damage victim by 4

Link to comment
Share on other sites

19 hours ago, Checkmate128 said:

I'm pretty sure it is supposed to be "event-item" and not "item-event"

Nvm it doesn't give any errors anymore but it doesn't work, the rest of the code works if I remove the if thing but now it works for all honey bottle.

 

 

Edited by Pancake123
I did things and realized it didn't work but I already replied.
Link to comment
Share on other sites

On 11/16/2022 at 7:54 PM, Pancake123 said:

@Checkmate128Do you know anything about the other issue? Changing it to event-item didnt fix it but removed the errors. The rest of the code works if I remove the if thing but then it happens for all honey bottles.

Option 1:

on consume of honey bottle:
    name of event-item is "&o&aGlue Bottle"
    effect player with nausea

Option 2:

on consume of honey bottle:
    if name of event-item is "&o&aGlue Bottle":
        effect player with nausea 

Either one should work.

Owner of oldgaffle.minehut.gg. (my paintball server)

Owner of karted.minehut.gg. (my mario kart server)

Advocate of individual freedom, especially freedom of speech.

Cooler than Stalemate128.

Link to comment
Share on other sites

4 hours ago, Pancake123 said:

@Checkmate128It doesn't work. It gives no errors but drinking a honey bottle named glue bottle does not give you nausea.

I want to do debugging and see which section is not working. Use this code:

on consume of honey bottle:
    broadcast "item type check passed"
    if name of event-item is "&o&aGlue Bottle":
        broadcast "item name check passed"
        effect player with nausea

Let me know what is outputted into chat when you apply my provided skript and drink the appropriately named honey bottle.

Owner of oldgaffle.minehut.gg. (my paintball server)

Owner of karted.minehut.gg. (my mario kart server)

Advocate of individual freedom, especially freedom of speech.

Cooler than Stalemate128.

Link to comment
Share on other sites

On 11/18/2022 at 9:18 PM, Checkmate128 said:

I want to do debugging and see which section is not working. Use this code:

on consume of honey bottle:
    broadcast "item type check passed"
    if name of event-item is "&o&aGlue Bottle":
        broadcast "item name check passed"
        effect player with nausea

Let me know what is outputted into chat when you apply my provided skript and drink the appropriately named honey bottle.

It gave me item type check passed. It did not do the other thing

 

Link to comment
Share on other sites

20 hours ago, Dannydino6 said:

maybe try
 

if name of event-itemtype contains "&aGlue":

 

I haven't fully tested that but that most likely works but probably not for the reason you think. I did some testing and for some reason the &o&a made it not work. I didn't think that was an issue because it changes nothing and it works for other code. For some reason for on consume it doesn't. I did get it to work however so that nice.

Edited by Pancake123
Forgot to mention I solved the problem.
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...