Solved command to sell virtual money

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

pfcdev

Member
Nov 7, 2021
2
0
1
31
Hello , I recently created a virtual currency on my server in the form of an item (gold nugget) with a custom name in color and a lore also personalized, I am looking for a way to make an order /selln which allows to sell this personalized item (and not the gold nuggets not modified) when the user in it is inventory and type the command

The script works, but my concern is that even if there are several golden pepites in the inventory it only gives me the value of a nugget

Code:
command /selln:
    trigger:
        if player is holding a gold nugget: # Ou : if player's tool is gold nugget:
            if name of tool of player is "Nom de ton item":
                if lore of tool of player contain "Une partie de ton lore": 
                    remove player's tool from player's inventory
                    send "Vous avez vendu cet objet" to player
                    add 10 to {Money::%player%} 
                    stop
                else:
                    send "Erreur: L'objet n'a pas la description requise" to player
                    stop
            else:
                send "Erreur: L'objet n'a pas le nom requis !" to player
                stop
        else:
            send "Erreur: L'objet n'est pas le bon !" to player
            stop
 
Use this:
Code:
remove 1 of the player's tool from player's inventory
if you only want one golden nugget to be removed from the player's inventory
 
Status
Not open for further replies.