Sell shop

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

Nicolai120111

Member
Feb 1, 2017
19
0
0
24
Hello everyone!

So i got this new server going around, and it's a prison server, and want so only the player who has permission to open a chest called a name. Can use it to sell forbidden items, and that is where you come in the picture, i want some help to start a sell skript, so when a player open a chest, that is called a name and have permission, it shall open 5 rows, and when he puts items in the chest, which i have added in the skript, and close the chest, it sells all the items, for the items total value, ex i open the chest called "&cGuard" and put 2 diamond, 1 dirt and 2 stone.. The diamond sells 100$ each, the dirt sells for 5$ each and stone sells for 1$ each, then i close the chest, and i sold for a total value of all the items value, so for my ex 207$ for the 2 diamonds, 1 dirt and 2 stone i put in the chest.

And remember, i want some help for the first part, ex the 1 varible for a items, then i add the rest, and the command, the close inventory part, and the price part, then i add the prices and items and messages i self, just need a little start. So i don't want a whole done skript, i will not learn anything by that, just some help for at start.

Hope you understand, if not let me know :emoji_wink:

- Nicolai
 
Hello everyone!

So i got this new server going around, and it's a prison server, and want so only the player who has permission to open a chest called a name. Can use it to sell forbidden items, and that is where you come in the picture, i want some help to start a sell skript, so when a player open a chest, that is called a name and have permission, it shall open 5 rows, and when he puts items in the chest, which i have added in the skript, and close the chest, it sells all the items, for the items total value, ex i open the chest called "&cGuard" and put 2 diamond, 1 dirt and 2 stone.. The diamond sells 100$ each, the dirt sells for 5$ each and stone sells for 1$ each, then i close the chest, and i sold for a total value of all the items value, so for my ex 207$ for the 2 diamonds, 1 dirt and 2 stone i put in the chest.

And remember, i want some help for the first part, ex the 1 varible for a items, then i add the rest, and the command, the close inventory part, and the price part, then i add the prices and items and messages i self, just need a little start. So i don't want a whole done skript, i will not learn anything by that, just some help for at start.

Hope you understand, if not let me know :emoji_wink:

- Nicolai
Use the correct request format.
 
I think you should watch these:
- On inventory close (SKQuery)
- (amount|number|size) of %objects% (Skript)

P/s: If you want the full code of it, reply or pm me
 
Sorry for missing a time, I'm working with my server
It's just an example, you can improve the code: (I have not tried it yet)
code_language.skript:
options:
    your-perm: Your.perm
    value-diamond: 100

on inventory close:
    if player has permission "{@your-perm}":
        if inventory name of player's current inventory is "&4Name Inventory":
            set {diamond.amount} to amount of diamond in player's current inventory
            set {moneyreceived.diamond} to {diamond.amount}*{@value-diamond}
            make console execute the command "/money give %player% %{moneyreceived}%"
 
could you please use the request format, it would be way easier to understand what you're saying. :emoji_relaxed:
 
could you please use the request format, it would be way easier to understand what you're saying. :emoji_relaxed:

Sorry for that, didn't see there was an request format thanks :emoji_wink:

- Nicolai
[doublepost=1508684912,1508684878][/doublepost]
Sorry for missing a time, I'm working with my server
It's just an example, you can improve the code: (I have not tried it yet)
code_language.skript:
options:
    your-perm: Your.perm
    value-diamond: 100

on inventory close:
    if player has permission "{@your-perm}":
        if inventory name of player's current inventory is "&4Name Inventory":
            set {diamond.amount} to amount of diamond in player's current inventory
            set {moneyreceived.diamond} to {diamond.amount}*{@value-diamond}
            make console execute the command "/money give %player% %{moneyreceived}%"


Hello.

Thanks! I will try the code now, sorry for late reply, have been on vacation :emoji_wink:

- Nicolai