HyperScript
Docs

← All of the Docs HyperGuard

Flags HyperGuard

expressionguard flag <flag> at <location>HyperGuard

What the flag comes to at that place: allow or deny, or the flag's own value; unset if no region sets it

if guard flag "pvp" at event's location is "deny":
    send action bar "&7No fighting here" to player
effectset guard flag <flag> of region <name> to <value>HyperGuard

Set a flag on a region, as /rg flag does

set guard flag "pvp" of region "arena" to true
effectclear guard flag <flag> of region <name>HyperGuard

Take the flag off the region again

clear guard flag "entry" of region "arena"
Guide and examples
command /arena <open|close>:
    permission: "arena.manage"
    trigger:
        if arg.1 is "open":
            set guard flag "pvp" of region "arena" to true
            set guard flag "greeting" of region "arena" to "&cFight!"
            clear guard flag "entry" of region "arena"
        else:
            set guard flag "pvp" of region "arena" to false
            set guard flag "entry" of region "arena" to "deny"
        send "&7Arena: %arg.1%"

on entity damage:
    if guard flag "pvp" at event's location is "deny":
        send action bar "&7No fighting here" to player
SyntaxEffect
guard flag <flag> at <location>What the flag comes to at that place: allow or deny, or the flag's own value; unset if no region sets it
set guard flag <flag> of region <name> to <value>Set a flag on a region, as /rg flag does
clear guard flag <flag> of region <name>Take the flag off the region again
  • The flag is written in quotes: "pvp", "entry", "greeting", "mob-spawning".
  • true and false mean allow and deny. Any other value is given as text, written the way it would be typed after /rg flag <region> <flag>.
  • A flag WorldGuard does not have, or a value the flag does not take, is reported in the console and nothing changes.