Fish rarities

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

    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.

Mattllama987

Supporter
Aug 5, 2018
225
7
18
Hello, Im making a fishing script, and need help with a little something. Im adding different rarities of fish with different names. Im trying to make common, well very common. Then i need the rare to be rare, epic to be harder than rare and legendary to be more rare than epic. I have a lot of the code done now. Im just not sure of the best way to pick a random fish but the common to be more common than all the other fishes. Same goes for all of them like i said. I dont have the other fish implemented at the moment. Once this problem gets fixed, Ill add the others into it. I know you can use loops to get different rarities. I think. But if someone could help me, i would appreciate it!

Thanks!
~Matt


Code:
on fishing:
    if player is in world "spawn":
        if fish state is CAUGHT_FISH:
            if {contest::started} is true:
                clear caught item
                loop 5 times:
                    add "1" to {_c::*}
                loop 4 times:
                    add "1" to {_c::*}
                loop 0.5 times:
                    add "1" to {_c::*}
                    set {fish} to random element out of {_c::*}
                add 1 to {contest::cought::%player%}
                set {fish::ran} to random integer between 1 and 7
                if {fish::ran} is 1:
                    set {_var} to random number between 3 and 7.99
                    if {_var} is less than 7.99:
                        give player a cod named "&7Common Shrimp" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught by %player%"
                        send "&8[&bFishing&8] &7%player% &7You cought a &7Common &aShrimp"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
                if {fish::ran} is 2:
                    set {_var} to random number between 7 and 12.99
                    if {_var} is less than 12.99:
                        give player a cod named "&7Common Anchovy" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aAnchovy"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
                if {fish::ran} is 3:
                    set {_var} to random number between 12 and 14.99
                    if {_var} is less than 14.99:
                        give player a cod named "&7Common Croaker" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aCroaker"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
                if {fish::ran} is 4:
                    set {_var} to random number between 10 and 14.99
                    if {_var} is less than 14.99:
                        give player a cod named "&7Common Crab" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aCrab"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
                if {fish::ran} is 5:
                    set {_var} to random number between 15 and 29.99
                    if {_var} is less than 29.99:
                        give player a cod named "&7Common Mackerel" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aMackerel"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
                if {fish::ran} is 6:
                    set {_var} to random number between 20 and 29.99
                    if {_var} is less than 29.99:
                        give player a cod named "&7Common Herring" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aHerring"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
                if {fish::ran} is 7:
                    set {_var} to random number between 10 and 29.99
                    if {_var} is less than 29.99:
                        give player a bread named "&7Common Breadfish" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aBreadfish"
                    if {_var} > ({size::fish::%player%} ? 0):
                        set {size::fish::%player%} to {_var}
[doublepost=1575914184,1575759407][/doublepost]bump
[doublepost=1576450753][/doublepost]bump
 
In skript, there is a variable used as so,

Code:
Chance of 85%:
    say "hi"
Chance of 15%
    say "hello"
[doublepost=1576861480,1576856437][/doublepost]
Code:
#If this doesn't work, let me know.

#If this gives you multiple items at once, let me know.

#Just contact me on SKunity forums if you need help.

#EliPlayz32


on fishing:
    if player is in world "spawn":
        Chance of 80%:     #you can change this percentage to whatever you want.
            give player a cod named "&7Common Shrimp" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught by %player%"
            send "&8[&bFishing&8] &7You caught a &aCommon Shrimp!"
            stop
        Chance of 80%:
            give player a cod named "&7Common Anchovy" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught by %player%"
            send "&8[&bFishing&8] &7You caught a &aCommon Anchovy!"
            stop
        Chance of 80%:
            give player a cod named "&7Common Croaker" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You caught a &aCommon &aCroaker!"
            stop
        Chance of 80%:
            give player a cod named "&7Common Crab" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You caught a &7Common &aCrab"
            stop
        Chance of 80%:
            give player a cod named "&7Common Mackerel" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &aCommon &aMackerel"
            stop
        Chance of 80%:
            give player a cod named "&7Common Herring" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &aCommon &aHerring"
            stop
        Chance of 80%:
            give player a bread named "&7Common Breadfish" with lore "&8* &aSize: %{_var}%cm" and "&b* &7Caught By %player%"
                        send "&8[&bFishing&8] &7You cought a &7Common &aBreadfish"
            stop
 
Status
Not open for further replies.