Solved Add money skript

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

TDragon_

Active Member
Jul 19, 2018
86
1
0
22
Hey, hey friends! I need help in a skript I'm doing... It is by check (of money). How do I do that when the player presses right on the check, get the money that he chose in the command? I will be grateful if you can help me, and sorry if English is bad, I do not speak your language very well :emoji_stuck_out_tongue:.
 
if you are meaning to add/remove money from a player, then just do
add <amount> to balance of %player%
or
remove <amount> from balance of %player%
and to check their bal just use
%balance of player%
 
if you are meaning to add/remove money from a player, then just do
add <amount> to balance of %player%
or
remove <amount> from balance of %player%
and to check their bal just use
%balance of player%
Does this work with money plugins? Like essentials or iconomy ...
 
yes, you just need to make sure you have vault as well
Hey men, says he does not understand this condition. I think you did not understand very well what I want, when a player gives /check add <amount>, he will win a role with name and such. There when he presses right button on the paper, it will add the amount of money that the player chose in the command. Understood?
 
yes i do, its the same effect I sent you, but you will have to show your code, I cant help you with just
"Hey men, says he does not understand this condition."
 
yes i do, its the same effect I sent you, but you will have to show your code, I cant help you with just
"Hey men, says he does not understand this condition."
code_language.skript:
command /cheque ajuda:
  trigger:
    send "&6-----------[ Ajuda cheque ]-----------"
    send "&f/chequebancar <money>: &aPara bancar um cheque com qualquer quantia de dinheiro"
    send "&6-----------[ Ajuda cheque ]-----------"

command /chequebancar <text>:
  trigger:
    give player 1 paper of fortune 1 named "&aCheque" with lore "&3Cheque de: &f%arg 1%$ ||&3De: &f%player% || ||&7Clique botão direito para adicionar a quantia a sua conta"
    message "&aFoi criado um cheque de %arg 1%$" to player

On right click holding a paper:
    if name of tool of player is "&aCheque":
        add 1 to balance of %player% #<------ here
        remove 1 paper from the player

If you do not understand something, tell me that I will translate.
 
so assuming your variable in the command is the dollar amount of the cheque, change
command /chequebancar <text>:
to
command /chequebancar <number>:

then after "give player 1" do something like
code_language.skript:
set {cheque::%player%} to arg-1
then, in your right click event, do
code_language.skript:
add {cheque::%player%} to balance of player
delete {cheque::%player%}
[doublepost=1532041316,1532041061][/doublepost]like this:
code_language.skript:
command /cheque ajuda:
  trigger:
    send "&6-----------[ Ajuda cheque ]-----------"
    send "&f/chequebancar <money>: &aPara bancar um cheque com qualquer quantia de dinheiro"
    send "&6-----------[ Ajuda cheque ]-----------"
 
command /chequebancar <number>:
  trigger:
    give player 1 paper of fortune 1 named "&aCheque" with lore "&3Cheque de: &f%arg 1%$ ||&3De: &f%player% || ||&7Clique botão direito para adicionar a quantia a sua conta"
    set {cheque::%player%} to arg-1
    message "&aFoi criado um cheque de %arg 1%$" to player
 
On right click holding a paper:
    if name of tool of player is "&aCheque":
        add {cheque::%player%} to balance of %player%
        delete {cheque::%player%}
        remove 1 paper from the player
 
so assuming your variable in the command is the dollar amount of the cheque, change
command /chequebancar <text>:
to
command /chequebancar <number>:

then after "give player 1" do something like
code_language.skript:
set {cheque::%player%} to arg-1
then, in your right click event, do
code_language.skript:
add {cheque::%player%} to balance of player
delete {cheque::%player%}
[doublepost=1532041316,1532041061][/doublepost]like this:
code_language.skript:
command /cheque ajuda:
  trigger:
    send "&6-----------[ Ajuda cheque ]-----------"
    send "&f/chequebancar <money>: &aPara bancar um cheque com qualquer quantia de dinheiro"
    send "&6-----------[ Ajuda cheque ]-----------"
 
command /chequebancar <number>:
  trigger:
    give player 1 paper of fortune 1 named "&aCheque" with lore "&3Cheque de: &f%arg 1%$ ||&3De: &f%player% || ||&7Clique botão direito para adicionar a quantia a sua conta"
    set {cheque::%player%} to arg-1
    message "&aFoi criado um cheque de %arg 1%$" to player
 
On right click holding a paper:
    if name of tool of player is "&aCheque":
        add {cheque::%player%} to balance of %player%
        delete {cheque::%player%}
        remove 1 paper from the player
mwpO5ap.png
 
oh right duh. sorry do:
add {cheque::%player%} to balance of player
accidentally did % around player
Many thanks man! It worked very well. But a question, can you hide the enchantment?
[doublepost=1532046539,1532045045][/doublepost]
oh right duh. sorry do:
add {cheque::%player%} to balance of player
accidentally did % around player
Thanks so much!
 
I’m not at my computer to test it but you could try do “give player 1 glowing paper” rather than adding an enchantment. If that doesn’t work then i’ll have to test it when I’m home
 
you can hide enchantments with skript mirror
code_language.skript:
import:
    org.bukkit.inventory.ItemFlag

set {_itemMeta} to {_item}.getItemMeta()
{_itemMeta}.addItemFlags(ItemFlag.HIDE_ENCHANTS!)
{_item}.setItemMeta({_itemMeta})
 
Last edited:
I’m not at my computer to test it but you could try do “give player 1 glowing paper” rather than adding an enchantment. If that doesn’t work then i’ll have to test it when I’m home
Hey man, I wanted to add a message when the guy pressed right on the paper but gave this problem:
wlStnik.png

[doublepost=1532216729,1532216628][/doublepost]
Hey man, I wanted to add a message when the guy pressed right on the paper but gave this problem:
wlStnik.png
I tried "message" too, but it gave the same problem
 
do an if statement, so if you have a variable, then you do:
code_language.skript:
if {money::to::take::%player%} <= balance of player:
    remove {money::to::take::%player%} from balance of player
    else:
        send "You do not have enough money for this" to player
 
Last edited:
do an if statement, so if you have a variable, then you do:
code_language.skript:
if {money::to::take::%player%} <= balance of player:
    remove {money::to::take::%player%} from balance of player
    else:
        send "You do not have enough money for this" to player
Is it possible to make it in the gui, when it squeezes into some icon, instead of closing, keep it open?
 
Status
Not open for further replies.