how do i remove things from {} (idk what they are called)

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

    Now, what are you waiting for? Join the community now!

Jun 15, 2023
1
0
1
i got a gen skript made but when i try to remove money from a player it never works i tryed to remove and subtract and some other things but idk how to do it
 
Last edited:
If removing doesn't work and you can't find a solution, you could just add negative values to it but you'd have to be very careful.

Example code:

Code:
command buyitem:
    trigger:
        add -100 to {pts::%player%}


However, something like this should work unless you have a small typo in your variable, also double check to see if your code is consistently defining the right variable type:
Code:
command buyitem:   
    trigger:
        remove 100 from {pts::%player%}

A couple issues I've had in the past with this kind of thing has been due to doing something like defining a variable as {example::%player's uuid%} in one file then later referring back to it to something like {example::%player%}. To combat this, you can have a command send the variable you're trying to subtract from and if it's a negative value after sending it in chat or if it doesn't match the current variable you're using for your code, it's likely that's not the right variable you're referring to and you'll need to debug that.
 
If removing doesn't work and you can't find a solution, you could just add negative values to it but you'd have to be very careful.

Example code:

Code:
command buyitem:
    trigger:
        add -100 to {pts::%player%}


However, something like this should work unless you have a small typo in your variable, also double check to see if your code is consistently defining the right variable type:
Code:
command buyitem: 
    trigger:
        remove 100 from {pts::%player%}

A couple issues I've had in the past with this kind of thing has been due to doing something like defining a variable as {example::%player's uuid%} in one file then later referring back to it to something like {example::%player%}. To combat this, you can have a command send the variable you're trying to subtract from and if it's a negative value after sending it in chat or if it doesn't match the current variable you're using for your code, it's likely that's not the right variable you're referring to and you'll need to debug that.
Luke I think ur a bit late (also use ::%player’s uuid% because %player% changes if someone changes their name so people could transfer accounts with it)
Edit: I forgot a ) at the end
 
  • Like
Reactions: Luke_Sky_Walker