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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Sell Skript

Discussion in 'Requests' started by thomas_nietoke, Apr 15, 2019.

Tags:
  1. thomas_nietoke

    Joined:
    Feb 26, 2019
    Messages:
    29
    Likes Received:
    0
    Category: Selling

    Suggested name: Sell

    Spigot/Skript Version: 1.12.2 Spigot / 2.2-dev36

    What I want: A sell skript that will sell Coal Ore for 5$ and Iron Ore for 10$ I want that when you sell you get 1 sell message wich says how many items you sold for how many $ I want to use a variable for this and that one is {balance::%player's uuid%} I've made a skript wich is basically what i want but i can't let it work:
    https://hastebin.com/jijicopaqo.py

    Ideas for commands: /Sell

    Ideas for permissions: Everyone has acces

    When I'd like it by: This week

    --- Double Post Merged, Apr 16, 2019, Original Post Date: Apr 15, 2019 ---
    Someone helped me in discord! Solved
     
  2. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Just to make sure if others need that heres something I wrote:
    Code (Skript):
    1.  
    2. command sell:
    3.     trigger:
    4.         set {_} to amount of iron ore in player' inventory
    5.         add {_}*10 to {balance::%player's uuid%}
    6.         send "You've sold %{_}% Iron ore for ({_]*10)$"
     
    #2 Runakai, Apr 17, 2019
    Last edited: Apr 19, 2019
  3. cuddlytrap

    cuddlytrap Member

    Joined:
    Dec 18, 2020
    Messages:
    26
    Likes Received:
    0
    it would probably be a good idea to remove the iron ore from the inventory after, so it would go like this:
    Code (Text):
    1.  
    2. command /sell:
    3.   trigger:
    4.     set {_iron} to amount of iron ore in player's inventory
    5.     add {_iron}*10 to {balance::%player's uuid%}
    6.     send "You've sold %{_}% Iron ore for ({_]*10)$"
    7.     remove {_iron} iron ore from player's inventory
     

Share This Page

Loading...