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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    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.

Solved Adding a variable to a player

Discussion in 'Skript' started by JamieGJampot, Jun 1, 2021.

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

    JamieGJampot Member

    Joined:
    May 16, 2021
    Messages:
    4
    Likes Received:
    0
    Hello, I am making a punish GUI & I need to know how to add a variable to a player. So when I click to ban the player it adds 1 to a variable for just that player, not everyone (like it is doing atm).

    My Code:

    Code (Text):
    1. command /punishmh [<offlineplayer>]:
    2.     permission: punish.use
    3.     permission message: &cYou do not have access to this command!
    4.     trigger:
    5.         message "&6PUNISH &7> &eChecking %arg-1%&e's history..." to player
    6.         add 1 to %arg-1% {punish.mh.%uuid of player%}
    7.         wait 60 ticks
    8.        
    9.         if {punish.mh.%uuid of player%} = 1:
    10.            
     
  2. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    4
    i don't really understand what you mean but you can just make a list ({bannedusers::*}) and then make it so that each player has their own spot on the list

    Ex:

    Code (Text):
    1.  
    2. add 1 to {bannedusers::%player%}
    3.  
    If what you mean is how to use a variable for an argument,

    Code (Text):
    1.  
    2. add 1 to {punish.mh.%uuid of arg%}
    3.  
     
  3. JamieGJampot

    JamieGJampot Member

    Joined:
    May 16, 2021
    Messages:
    4
    Likes Received:
    0
    Sorry for being so vague, I think I have fixed it with your help :emoji_slight_smile: I am getting a few other errors tho:

    Code:
    Code (Text):
    1. # Variables
    2.  
    3.  
    4. # Malicious Hacks
    5.  
    6. on login:
    7.     if {punish.mh.%uuid of arg%} is not set:
    8.         set {punish.mh.%uuid of arg%} to 0
    9.        
    10.        
    11. # Disallowed Modifications
    12.  
    13. on login:
    14.     if {punish.dm.%uuid of arg%} is not set:
    15.         set {punish.dm.%uuid of arg%} to 0
    16.        
    17.  
    18. # Glitch Exploiting
    19.  
    20. on login:
    21.     if {punish.ge.%uuid of arg%} is not set:
    22.  
    23.  
    24.         set {punish.ge.%uuid of arg%} to 0

    Thanks :emoji_slight_smile:
     

    Attached Files:

  4. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    4
    If you're not using a command, you need to use %uuid of player%. An argument is the 2nd part of a command. Example: command /ban "<text>"
    Text would be the argument. So only use arg in commands and use uuid of player in this situation.
     
  5. JamieGJampot

    JamieGJampot Member

    Joined:
    May 16, 2021
    Messages:
    4
    Likes Received:
    0
    It worked, thank you for all your help
     
Thread Status:
Not open for further replies.

Share This Page

Loading...