Solved Leveling System

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

DarkMbs

Member
Jun 19, 2019
10
0
0
I want to make a leveling system which unlocks crops.
for a player to unlock potatoes for planting and selling they need to start by growing X number of wheat.
next, they need to grow X numbers of potatoes to unlock carrots etc.... i just want to know is there a way i can keep a count of how many crops a player has grown
 
You will need to keep track of each crop.

Player plants the seed: +1 to the crop total
Player breaks the plant before the plant is ready to harvest: -1 to the crop total
Player harvests: no change in total​

If you don't want automatic farms to count as the crop number, you can do this:
Player plants the seed: no change
Player breaks the plant before the plant is ready to harvest: no change
Player harvests: +1 to the crop total​

If you want the player to PLANT and HARVEST, at the same time:


Player plants the seed: +1 to the variable of planted seeds
Player breaks the plant before the plant is ready to harvest: -1 to the variable of planted seeds
Player harvests: +1 to the crop total*

* Only allow the crop variable to have a number equal or lower to the seed variable. This way, a player can only raise the level by both planting and harvesting. Of course, this does not prevent a player from planting the seed (+1 to the variable of planted seeds) and harvesting a world generated plant in a village for example. But this would somewhat limit the total crop number variable, thus enabling control of the system.​

If you just keep track of the crop number, without removing from the broken not fully grown crop, the player would abuse by planting and breaking to get the seed back and plant again.

You should lookup the docs for making this. Is not complicated.
 
You will need to keep track of each crop.

Player plants the seed: +1 to the crop total
Player breaks the plant before the plant is ready to harvest: -1 to the crop total
Player harvests: no change in total​

If you don't want automatic farms to count as the crop number, you can do this:
Player plants the seed: no change
Player breaks the plant before the plant is ready to harvest: no change
Player harvests: +1 to the crop total​

If you want the player to PLANT and HARVEST, at the same time:


Player plants the seed: +1 to the variable of planted seeds
Player breaks the plant before the plant is ready to harvest: -1 to the variable of planted seeds
Player harvests: +1 to the crop total*

* Only allow the crop variable to have a number equal or lower to the seed variable. This way, a player can only raise the level by both planting and harvesting. Of course, this does not prevent a player from planting the seed (+1 to the variable of planted seeds) and harvesting a world generated plant in a village for example. But this would somewhat limit the total crop number variable, thus enabling control of the system.​

If you just keep track of the crop number, without removing from the broken not fully grown crop, the player would abuse by planting and breaking to get the seed back and plant again.

You should lookup the docs for making this. Is not complicated.
i cant find the docs related to what i want can i get a link?
[doublepost=1563733775,1563733478][/doublepost]I also want to make a sort of comparison to the crop grown and the crop required so players can unlock it when the limit is reached but when i try to compare it, it says cant compare the crop grown to an integer
 
The doc you need is the event "on rightclick"

In this case, "on rightclick on soil:"
 
The doc you need is the event "on rightclick"

In this case, "on rightclick on soil:"
now how do i compare the farmed to the amount required?
Code:
command /carr1:
    trigger:
        if %{crops::grown::%player%}% is equal to or greater than 200:
            message "You have reached the limit"
 
Why are you using a command?
You should use again the event "on rightclick".

Example: You want players to just plant potatoes, and later let them plant wheat:

Code:
on rightclick on soil:
    player tool is wheat:
        #dostuff (check if the player can plant wheat)
 
Why are you using a command?
You should use again the event "on rightclick".

Example: You want players to just plant potatoes, and later let them plant wheat:

Code:
on rightclick on soil:
    player tool is wheat:
        #dostuff (check if the player can plant wheat)
yea ok but i want it to unlock the next crop when they have completed the required amount or farming wheat
 
Status
Not open for further replies.