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
[doublepost=1575914184,1575759407][/doublepost]bump
[doublepost=1576450753][/doublepost]bump
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=1576450753][/doublepost]bump