Double Wardens skript bug.

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

habbic

Member
Mar 18, 2024
29
0
1
24
Code:
command /warden:
    cooldown: 5 seconds
    trigger:
        set {warden} to true



on command "/warden":
    if {warden} is true:
        send "&c&lError &c- There is a warden wait till the warden dies!"
    else:
        clear player's inventory
        send title "&c%player% Is now the &c&lWARDEN" to all players
        play sound "block.end_portal.spawn" to all players
        set player's group to "warden"
        teleport player to {wardenspawn}
        wait 3 ticks
        set player's helmet slot to {wardenh}
        set player's chestplate slot to {wardenc}
        set player's leggings slot to {wardenl}
        set player's boots slot to {wardenb}
        give player 1 of {wardens}
        give player 1 of {keycard}
        give player 1 of bow
        give player 64 of arrows
        give player 64 of {steak}

on death:
    if victim's group = "warden":
        set {warden} to false
        set victim's group to "default"
 
Code:
command /warden:
    cooldown: 5 seconds
    trigger:
        set {warden} to true



on command "/warden":
    if {warden} is true:
        send "&c&lError &c- There is a warden wait till the warden dies!"
    else:
        clear player's inventory
        send title "&c%player% Is now the &c&lWARDEN" to all players
        play sound "block.end_portal.spawn" to all players
        set player's group to "warden"
        teleport player to {wardenspawn}
        wait 3 ticks
        set player's helmet slot to {wardenh}
        set player's chestplate slot to {wardenc}
        set player's leggings slot to {wardenl}
        set player's boots slot to {wardenb}
        give player 1 of {wardens}
        give player 1 of {keycard}
        give player 1 of bow
        give player 64 of arrows
        give player 64 of {steak}

on death:
    if victim's group = "warden":
        set {warden} to false
        set victim's group to "default"
I would guess by the logic, it would make more sense to combine 'on command /warden' and your actual warden command together to make it a little easier to read and to have your code be a little shorter (Also, you should check that {warden} is false BEFORE attempting to set it to true), otherwise, regardless of what happens in game, running the /warden command will always make it true.
 
I would guess by the logic, it would make more sense to combine 'on command /warden' and your actual warden command together to make it a little easier to read and to have your code be a little shorter (Also, you should check that {warden} is false BEFORE attempting to set it to true), otherwise, regardless of what happens in game, running the /warden command will always make it true.
Well i dont know how to do that.
 
Well i dont know how to do that.
AppleScript:
command /warden:
    cooldown: 5 seconds
    trigger:
        if {warden} is true:
            send "&c&lError &c- There is a warden wait till the warden dies!"
        else:
            set {warden} to true
            clear player's inventory
            send title "&c%player% Is now the &c&lWARDEN" to all players
            play sound "block.end_portal.spawn" to all players
            set player's group to "warden"
            teleport player to {wardenspawn}
            wait 3 ticks
            set player's helmet slot to {wardenh}
            set player's chestplate slot to {wardenc}
            set player's leggings slot to {wardenl}
            set player's boots slot to {wardenb}
            give player 1 of {wardens}
            give player 1 of {keycard}
            give player 1 of bow
            give player 64 of arrows
            give player 64 of {steak}

on death:
    if victim's group = "warden":
        set {warden} to false
        set victim's group to "default"
 
AppleScript:
command /warden:
    cooldown: 5 seconds
    trigger:
        if {warden} is true:
            send "&c&lError &c- There is a warden wait till the warden dies!"
        else:
            set {warden} to true
            clear player's inventory
            send title "&c%player% Is now the &c&lWARDEN" to all players
            play sound "block.end_portal.spawn" to all players
            set player's group to "warden"
            teleport player to {wardenspawn}
            wait 3 ticks
            set player's helmet slot to {wardenh}
            set player's chestplate slot to {wardenc}
            set player's leggings slot to {wardenl}
            set player's boots slot to {wardenb}
            give player 1 of {wardens}
            give player 1 of {keycard}
            give player 1 of bow
            give player 64 of arrows
            give player 64 of {steak}

on death:
    if victim's group = "warden":
        set {warden} to false
        set victim's group to "default"
All the warden stuff should be stored in a list variable ngl