Sythical Posted August 30, 2020 Share Posted August 30, 2020 Hello. Recently, I have began development on my new skyblock server. I have gotten way better at skript ever since I started this project, but I still have no idea how to create a custom /sell command. What I want the command to do is when you do /sell, the skript checks all the items in your inventory and if one of your items matches the skripts variables, you sell it for a custom amount. And, for people that buy ranks, they get a multiplier. For example, (1,3x 1.5x 1.7x 2.0x). Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
_Tarna_ Posted August 30, 2020 Share Posted August 30, 2020 command /sell: trigger: set {_s} to amount of stone in player's inventory add {_s}*10*{multi::%player's uuid%} to {money::%player's uuid%} and {_total} send "You have sold all your stuff for $%{_total}%" Here is an example of how you can make a sell command. I added it to the money variable and a local total variable so you can display how much you sold everything for. And what do you mean by if the item matches the skript variables? Are you going to have a variable for the prices of each items? You can just use that variable instead of putting 10 like I did in the skript. Also if you want it to say like you have no items to sell, you could check if {_total} is 0 and send that messages instead of the other one. Discord - tarna256 In-game name - _Tarna_ Website - https://tarna.dev Paste Site: https://paste.tarna.dev --------------------------------------------------------- [VIP] - 7/27/2020 Community Support - 7/8/20 | 11/3/20 Helper - 11/3/20 - 2/21/21 Moderator - 2/21/21 - 5/17/21 - 5/17/21 - now Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
Sythical Posted August 30, 2020 Author Share Posted August 30, 2020 35 minutes ago, _Tarna_ said: command /sell: trigger: set {_s} to amount of stone in player's inventory add {_s}*10*{multi::%player's uuid%} to {money::%player's uuid%} and {_total} send "You have sold all your stuff for $%{_total}%" Here is an example of how you can make a sell command. I added it to the money variable and a local total variable so you can display how much you sold everything for. And what do you mean by if the item matches the skript variables? Are you going to have a variable for the prices of each items? You can just use that variable instead of putting 10 like I did in the skript. Also if you want it to say like you have no items to sell, you could check if {_total} is 0 and send that messages instead of the other one. Hey, could you explain what this line does? add {_s}*10*{multi::%player's uuid%} to {money::%player's uuid%} and {_total} Link to comment Share on other sites More sharing options...
_Tarna_ Posted August 30, 2020 Share Posted August 30, 2020 6 minutes ago, Sythical said: Hey, could you explain what this line does? add {_s}*10*{multi::%player's uuid%} to {money::%player's uuid%} and {_total} {_s} holds the amount of stone the player has. and 10 is the price for each stone so it multiplies the amount of stone by the price. Then you said you also wanted a multi for players. So the variable {multi::%player's uuid%} can hold a number like 2 for a 2x multi. So it will also multiple it by 2 so the cost of the stone goes higher. Then it gets added to the player's money, which is {money::%player's uuid%}. You can change the variable to what ever your economy variable is. And it also gets added to {_total} so at the end, you can display how much you sold everything for since you will have multiple things to sell. Discord - tarna256 In-game name - _Tarna_ Website - https://tarna.dev Paste Site: https://paste.tarna.dev --------------------------------------------------------- [VIP] - 7/27/2020 Community Support - 7/8/20 | 11/3/20 Helper - 11/3/20 - 2/21/21 Moderator - 2/21/21 - 5/17/21 - 5/17/21 - now Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
Sythical Posted August 30, 2020 Author Share Posted August 30, 2020 1 minute ago, _Tarna_ said: {_s} holds the amount of stone the player has. and 10 is the price for each stone so it multiplies the amount of stone by the price. Then you said you also wanted a multi for players. So the variable {multi::%player's uuid%} can hold a number like 2 for a 2x multi. So it will also multiple it by 2 so the cost of the stone goes higher. Then it gets added to the player's money, which is {money::%player's uuid%}. You can change the variable to what ever your economy variable is. And it also gets added to {_total} so at the end, you can display how much you sold everything for since you will have multiple things to sell. Wow, thank you so much! Do you mind if I add your discord? I want to continue the skript and if I'm stuck I'll probably need some help. Link to comment Share on other sites More sharing options...
_Tarna_ Posted August 30, 2020 Share Posted August 30, 2020 2 minutes ago, Sythical said: Wow, thank you so much! Do you mind if I add your discord? I want to continue the skript and if I'm stuck I'll probably need some help. Sure. You can message me if you need help with anything else. You can also join the Minehut Discord and ask for skript help there in the skript channel. discord.gg/minehut Discord - tarna256 In-game name - _Tarna_ Website - https://tarna.dev Paste Site: https://paste.tarna.dev --------------------------------------------------------- [VIP] - 7/27/2020 Community Support - 7/8/20 | 11/3/20 Helper - 11/3/20 - 2/21/21 Moderator - 2/21/21 - 5/17/21 - 5/17/21 - now Moderator - 12/20/22 - now --------------------------------------------------------- Link to comment Share on other sites More sharing options...
davante2007 Posted April 22, 2021 Share Posted April 22, 2021 ehh this is a bit late but i want to create a /sell cobblestone [<amount>] command, but if i try to do something with if player's inventory contains cobblestone then it says doesn't understand this condition Link to comment Share on other sites More sharing options...
herofireTY Posted June 12, 2021 Share Posted June 12, 2021 #tarna is god 1 Link to comment Share on other sites More sharing options...
boxboxbox Posted June 12, 2021 Share Posted June 12, 2021 Locking this thread. Please make sure that you aren't responding to posts that haven't been responded to in over a month. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts