Solved %string% or %string%?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Wynnevir

Well-Known Member
Jul 9, 2017
1,015
62
48
30
Elsewhere
I'm trying to clean up and condense some of my old code, but can't find a way to do this properly.
The original code is this:
code_language.skript:
on mine of diamond ore:
    set {_m} to false
    if mining level of player < "300" parsed as an integer:
        set {_m} to true
    if excavation level of player < "60" parsed as an integer:
        set {_m} to true
    if {_m} is true:
        message "&e&l[&d&l!&e&l] &r&7Level up to mine &9diamond&7. You need:"
        message "&9Mining Lvl 300 &f:: &7Current Lvl %mining level of player%"
        message "&9Excavation Lvl 60 &f:: &7Current Lvl %excavation level of player%"
        cancel event
What I want to do instead of that is like "if mining level or excavation level:"
code_language.skript:
if mining level of player < 300 or excavation level of player < 60:
While this reloads with no errors, it just doesn't run either check to cancel the event.

So overhead question: Can skript handle "or" comparisons like this? and if so, how do I properly format that?
 
I was reading something similar to this a couple months back. It isn't possible since Skript has no built-in feature for it.
 
  • Like
Reactions: Wynnevir
It's not possible in a nice way. The best way to shorten in this case would be as follows:
code_language.skript:
on mine of diamond ore:
    if ((check [mining level of player < 300] and check [excavation level of player < 60]) where [boolean input is true]) is set:
        message "&e&l[&d&l!&e&l] &r&7Level up to mine &9diamond&7. You need:"
        message "&9Mining Lvl 300 &f:: &7Current Lvl %mining level of player%"
        message "&9Excavation Lvl 60 &f:: &7Current Lvl %excavation level of player%"
        cancel event
 
Status
Not open for further replies.