Variables

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

OMG_Tobias

Member
Jan 26, 2017
13
0
0
24
Greetings,
I've stumbled across a problem while writing a KitPVP plugin I am working on for a server.
This problem consists of players having the ability to claim more than one kit, however, I do not want this luxury to occur anymore. Therefore, players will only be able to claim 1 kit per life, until the die.
However, this code provided below does not seem to be working correctly.
Could someone assist me this is occurrence?
code_language.skript:
on join:
    set {kit.%player%} to true
on quit:
    set {kit.%player%} to false
on death:
    set {kit.%player%} to true
    



Command /testing:
    Trigger:
        if {kit.%player%} is true:
        Send "Received." to player
        set helmet of the player to a chain helmet of unbreaking 5 and protection 1
        set chestplate of the player to a chain chestplate of unbreaking 5 and protection 1
        set leggings of the player to a chain leggings of unbreaking 5 and protection 1
        set boots of the player to a chain boots of unbreaking 5 and protection 1
        set slot 0 of player's inventory to iron sword of sharpness 2
        set slot 1 of player's inventory to fishing rod of unbreaking 5
        set {kit.%player%} to false
        if {kit.%player%} is false:
        Send "You can only get a kit once you have died." to player
        stop
 
Greetings,
I've stumbled across a problem while writing a KitPVP plugin I am working on for a server.
This problem consists of players having the ability to claim more than one kit, however, I do not want this luxury to occur anymore. Therefore, players will only be able to claim 1 kit per life, until the die.
However, this code provided below does not seem to be working correctly.
Could someone assist me this is occurrence?
code_language.skript:
on join:
    set {kit.%player%} to true
on quit:
    set {kit.%player%} to false
on death:
    set {kit.%player%} to true
  



Command /testing:
    Trigger:
        if {kit.%player%} is true:
        Send "Received." to player
        set helmet of the player to a chain helmet of unbreaking 5 and protection 1
        set chestplate of the player to a chain chestplate of unbreaking 5 and protection 1
        set leggings of the player to a chain leggings of unbreaking 5 and protection 1
        set boots of the player to a chain boots of unbreaking 5 and protection 1
        set slot 0 of player's inventory to iron sword of sharpness 2
        set slot 1 of player's inventory to fishing rod of unbreaking 5
        set {kit.%player%} to false
        if {kit.%player%} is false:
        Send "You can only get a kit once you have died." to player
        stop
You need to add a tab when using an if / else statement, e.g:

If {kit.%player%} is false:
<tab>Send "You can only get a kit once you have died." To player
 
Status
Not open for further replies.