Solved Adding a variable to a player

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

JamieGJampot

Member
May 16, 2021
4
0
1
24
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:
command /punishmh [<offlineplayer>]:
    permission: punish.use
    permission message: &cYou do not have access to this command!
    trigger:
        message "&6PUNISH &7> &eChecking %arg-1%&e's history..." to player
        add 1 to %arg-1% {punish.mh.%uuid of player%}
        wait 60 ticks
        
        if {punish.mh.%uuid of player%} = 1:
 
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:
add 1 to {bannedusers::%player%}

If what you mean is how to use a variable for an argument,

Code:
add 1 to {punish.mh.%uuid of arg%}
 
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:
# Variables


# Malicious Hacks

on login:
    if {punish.mh.%uuid of arg%} is not set:
        set {punish.mh.%uuid of arg%} to 0
       
       
# Disallowed Modifications

on login:
    if {punish.dm.%uuid of arg%} is not set:
        set {punish.dm.%uuid of arg%} to 0
       

# Glitch Exploiting

on login:
    if {punish.ge.%uuid of arg%} is not set:


        set {punish.ge.%uuid of arg%} to 0


Thanks :emoji_slight_smile:
 

Attachments

  • upload_2021-6-2_11-18-48.png
    upload_2021-6-2_11-18-48.png
    602.5 KB · Views: 102
  • upload_2021-6-2_11-23-32.png
    upload_2021-6-2_11-23-32.png
    64.8 KB · Views: 88
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.
 
Status
Not open for further replies.