Solved How to create zone without damage?

  • 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!

AlliSighs

Member
Feb 12, 2024
41
0
6
14
Code:
command /getWand:
    trigger:
        give player blaze rod named

on leftclick with blaze rod:
    set {p1} to location of event-block
    send "&ap1 setted" to player

on rightclick with blaze rod:
    set {p2} to location of event-block
    send "&ap2 setted" to player

command /setSafeZone:
    trigger:
        set blocks between {p1} and {p2} to {@safeZone}
        send "&aSafe zone create."

on eat of enchanted golden apple:
    if name of event-item is "&bBoom":
        set player's flight mode to true
        apply invisibility to player for 30 seconds
        set {_playerloc} to location of player
        create a safe explosion of force 5 at {_playerloc}
        loop all players in radius 5 of player:
            "%loop-player%" is not "%player%"
            if location of loop-player is not {@safeZone}:
                damage loop-player by 4
                send "&c&n&o%loop-player%&c&o -4 HP!" to player

No errors, but players in {@safeZone} are still taking damage. What to do?
 
Whats your safezone option set to. Also the setsafezone command is pointless. Replace it with a damag event and cancel that event if the victim is within p1 and p2
 
Solved!
1712955185176.png
 
Btw:

its set, not setted
use loop-player is not player rather than "%loop-player%" is not "%player%"
/setsafezone is pointless, and when you do that command, you're setting the blocks within the variables to @safezone, not setting @safezone to those blocks, so what exactly is that option set to because from my perspective it doesn't look like it should work