Solved random drops

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

EPicAnid

Member
Aug 9, 2019
10
0
0
40
hello, today I am working on coding a plugin for my server
variables:
{Fishodds} = 0



Code:
on fish:
   if "%fishing state%" is "CAUGHT_FISH":
       set {Fishodds} to a random integer between 0 and 101
       if {Fishodds} is less than 51:
           message "fish"
           give the player 1 fish
       if {Fishodds} is greater than 50 and less than 71:
           message "salmon"
           give the player 1 salmon
       if {Fishodds} is greater than 70 and less than 81:
           message "puffer"
           give the player 1 pufferfish
       if {Fishodds} is greater than 80 and less than 91:
           message "sack"
           give the player 1 ink sack
       if {Fishodds} is greater than 90 and less than 101:
           message "egg"
           give the player 1 ender pearl renamed "fish eggs"

I get these errors

For every if statement:
Numeric ids are not supported anymore. (General.sk, line 108: if {Fishodds} is greater than 50 and less than 71:')

only for the first give statement:
Can't understand this condition/effect: give the player 1 fish (General.sk, line 105: give the player 1 fish')
 
hello, today I am working on coding a plugin for my server
variables:
{Fishodds} = 0



Code:
on fish:
   if "%fishing state%" is "CAUGHT_FISH":
       set {Fishodds} to a random integer between 0 and 101
       if {Fishodds} is less than 51:
           message "fish"
           give the player 1 fish
       if {Fishodds} is greater than 50 and less than 71:
           message "salmon"
           give the player 1 salmon
       if {Fishodds} is greater than 70 and less than 81:
           message "puffer"
           give the player 1 pufferfish
       if {Fishodds} is greater than 80 and less than 91:
           message "sack"
           give the player 1 ink sack
       if {Fishodds} is greater than 90 and less than 101:
           message "egg"
           give the player 1 ender pearl renamed "fish eggs"

I get these errors

For every if statement:
Numeric ids are not supported anymore. (General.sk, line 108: if {Fishodds} is greater than 50 and less than 71:')

only for the first give statement:
Can't understand this condition/effect: give the player 1 fish (General.sk, line 105: give the player 1 fish')
Instead of using "is greater than" and "is less than" use:
code_language.skript:
if {Fishodds} is between 0 and 51
And if I'm not mistaken, the correct use of the "give" effect is:
code_language.skript:
give (number) of (item) to the player
 
Status
Not open for further replies.