1. 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!


    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript not reading a variable

Discussion in 'Skript' started by SuperEpps22556, Jun 29, 2020.

Thread Status:
Not open for further replies.
  1. SuperEpps22556

    Oct 3, 2017
    Likes Received:
    Skript Version: Skript 2.4.1
    Skript Author: Bensku
    Minecraft Version: 1.15

    Full Code:
    Code (Text):
    1. on projectile hit:
    2.     if projectile is an arrow:
    3.         if shooter is a player:
    4.             if {perk.explosive.%shooter%} is true:
    5.                 wait 3 seconds
    6.                 create an explosion of force 3.5 at location of projectile
    7.                 delete projectile
    I don't understand why the script isn't reading "if {perk.explosive.%shooter%} is true:" as I broke it down piece by piece to see what the error was followed by this code that works. The projectile is shot, hits anything, and doesn't explode.

    Code (Text):
    1. command /pk [<text>]:
    2.     trigger:
    3.         if arg-1 is "clear":
    4.             [code]
    5.         if arg-1 is "explosive":
    6.             if {perk.slot.%player%} is true:
    7.                 send "&cOnly one perk can be active at a time!" to the player
    8.                 stop
    9.             if {perk.slot.%player%} is false:
    10.                 if player has permission "perk.perk.earrow":
    11.                     send "&aExplosive Arrows perk activated!" to the player
    12.                     set {perk.slot.%player%} to true
    13.                     set {perk.explosive.%player%} to true
    14.                     set {perkslot.slot.%player%} to bow named "&bExplosive Arrow"
    I did a smaller scale test of this code and it works fine. I've been scratching my head since there's no console errors or skript errors.
    Code (Text):
    1. command /test:
    2.     trigger:
    3.         if {perk.explosive.%player%} is true:
    4.             send "This works" to the player

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Scrolling through I haven't seen it
    What other methods have you tried to fix it? Tried setting different "if" statements and taking out lines. Adding a 'Send "This should work" to the shooter' line to see what line it's not picking up. Worldguard is installed and I tried setting the region to creeperexplosion allow, otherexplosion allow, and tnt allow
Thread Status:
Not open for further replies.

Share This Page