not work skript random 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!

krzychul

Member
Feb 22, 2024
1
0
1
24
I found this script on this forum, I wanted to replace it with a paper called after use it draws money from 1 to 5k, but something doesn't work, are there any errors, can someone help?

[13:36:23] [Server thread/INFO]: [Skript] Reloading zdrapka.sk...
[13:36:23] [Server thread/INFO]: Line 4: (examples\zdrapka.sk)
[13:36:23] [Server thread/INFO]: In the future, players in variable names will use the player's UUID instead of their name. For information on how to make sure your scripts won't be impacted by this change, see https://github.com/SkriptLang/Skript/discussions/6270.
[13:36:23] [Server thread/INFO]: Line: set {%player%.randommoney} to random integer between 1 and 100
[13:36:23] [Server thread/INFO]:
[13:36:23] [Server thread/INFO]: Line 4: (examples\zdrapka.sk)
[13:36:23] [Server thread/INFO]: Starting a variable's name with an expression is discouraged ({%player%.randommoney}). You could prefix it with the script's name: {examples\zdrapka::%player%.randommoney}
[13:36:23] [Server thread/INFO]: Line: set {%player%.randommoney} to random integer between 1 and 100
[13:36:23] [Server thread/INFO]:
[13:36:23] [Server thread/INFO]: Line 6: (examples\zdrapka.sk)
[13:36:23] [Server thread/INFO]: There are multiple command senders in an on click event. You must define which command sender to use.
[13:36:23] [Server thread/INFO]: Line: send "&8[&6&lO&8] &7You got %{player.randommoney}%.You got &2%player's balance% money now"
[13:36:23] [Server thread/INFO]:
[13:36:23] [Server thread/INFO]: [Skript] Encountered 1 error while reloading zdrapka.sk! (16ms)

CODE:
On right click holding a firework star:
chance of 50%:
wait 3 ticks
set {%player%.randommoney} to random integer between 1 and 100
add {player.randommoney} to the player's balance
send "&8[&6&lO&8] &7You got %{player.randommoney}%.You got &2%player's balance% money now"
remove 1 firework star from player
 
I found this script on this forum, I wanted to replace it with a paper called after use it draws money from 1 to 5k, but something doesn't work, are there any errors, can someone help?

[13:36:23] [Server thread/INFO]: [Skript] Reloading zdrapka.sk...
[13:36:23] [Server thread/INFO]: Line 4: (examples\zdrapka.sk)
[13:36:23] [Server thread/INFO]: In the future, players in variable names will use the player's UUID instead of their name. For information on how to make sure your scripts won't be impacted by this change, see https://github.com/SkriptLang/Skript/discussions/6270.
[13:36:23] [Server thread/INFO]: Line: set {%player%.randommoney} to random integer between 1 and 100
[13:36:23] [Server thread/INFO]:
[13:36:23] [Server thread/INFO]: Line 4: (examples\zdrapka.sk)
[13:36:23] [Server thread/INFO]: Starting a variable's name with an expression is discouraged ({%player%.randommoney}). You could prefix it with the script's name: {examples\zdrapka::%player%.randommoney}
[13:36:23] [Server thread/INFO]: Line: set {%player%.randommoney} to random integer between 1 and 100
[13:36:23] [Server thread/INFO]:
[13:36:23] [Server thread/INFO]: Line 6: (examples\zdrapka.sk)
[13:36:23] [Server thread/INFO]: There are multiple command senders in an on click event. You must define which command sender to use.
[13:36:23] [Server thread/INFO]: Line: send "&8[&6&lO&8] &7You got %{player.randommoney}%.You got &2%player's balance% money now"
[13:36:23] [Server thread/INFO]:
[13:36:23] [Server thread/INFO]: [Skript] Encountered 1 error while reloading zdrapka.sk! (16ms)

CODE:
On right click holding a firework star:
chance of 50%:
wait 3 ticks
set {%player%.randommoney} to random integer between 1 and 100
add {player.randommoney} to the player's balance
send "&8[&6&lO&8] &7You got %{player.randommoney}%.You got &2%player's balance% money now"
remove 1 firework star from player
One of the biggest issues I see with that code right away is that it’s not consistent. {player.randommoney} is not defined because it doesn’t match the variable you set a random number to on the previous line. Same with the line after.
 
There is a problem with your variable use case, try something else instead of this:
Code:
set {%player%.randommoney} to random integer between 1 and 100
add {player.randommoney} to the player's balance
try this:
Code:
set {_randommoney} to random integer between 1 and 100
add {_randommoney} to the player's balance

learn more about variables:
 
There is a problem with your variable use case, try something else instead of this:
Code:
set {%player%.randommoney} to random integer between 1 and 100
add {player.randommoney} to the player's balance
try this:
Code:
set {_randommoney} to random integer between 1 and 100
add {_randommoney} to the player's balance

learn more about variables:
Omg its ult