1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[CLOSED] Farming Simulator

Discussion in 'Requests' started by GeekWithAChick, Feb 9, 2017.

  1. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    I was boring. so i joined the "Party". :emoji_grinning:

    You can increase the Radius while you leveling it, when your don't have this tool. you will not harvest it. so like in Farming simulator. You need one Things for Wheat... One other Things for.. .example potato... so you can set here easy up. Just Change the Name or somethings. and check it. if you're holding nothing. will he nothing harvesting... :emoji_wink: (Sorry my bad English today maybe)

    Code (Skript):
    1. on vehicle enter:
    2.     wait 1 tick
    3.     "%entity%" is "boat"
    4.     while player is riding:
    5.         wait 5 ticks
    6.  
    7.         if block at player's vehicle is farmland:
    8.             set {_block} to block in horizontal direction of player's vehicle from player
    9.             {_block} is not farmland
    10.             {_block} is not water
    11.             block above {_block} is air
    12.             make player execute "/up"
    13.         if name of player's tool contains "Harvester":
    14.             set {_N::*} to name of player's tool split at "Level "
    15.             replace every "]" with "" in {_N::2}
    16.             set {_r} to {_N::2} parsed as number #RADIUS
    17.         else:
    18.             send action bar from "&a&lRemain for Harvester you need some tool." to player
    19.         broadcast "Level: %{_r}% - So its mean too Radius." #!DEBUGS
    20.         if {_r} is set:
    21.             loop blocks in radius {_r} around block above block at player:
    22.                 y-coord of loop-block is y-coord of block above block at player
    23.                 loop-block is not air
    24.                 set {_block} to loop-block
    25.                 if name of player's tool contains "Harvester":
    26.                     set {_amount} to random number between 1 and 3
    27.                     if "%{_block}%" contains "wheat":
    28.                         data value of {_block} is 7
    29.                         set data value of block at {_block} to 0
    30.                         drop {_amount} of wheat at block at {_block}
    31.                         add 1 to {_EXP}
    32.  
    33.                     else if "%{_block}%" contains "carrot":
    34.                         data value of {_block} is 7
    35.                         set data value of block at {_block} to 0
    36.                         drop {_amount} of carrots at block at {_block}
    37.                         add 1 to {_EXP}
    38.                 else:
    39.                     send action bar from "&c&lWrong Tool!" to player
    40.             if {_EXP} is set:
    41.                 set {_N::*} to name of player's tool split at "Level "
    42.                 replace every "]" with "" in {_N::2}
    43.                 set {_r} to {_N::2} parsed as number
    44.                 if {_r} is more than or equal to 10:
    45.                     set name of player's tool to "%{_N::1}%Level MAX]"
    46.                     set lore of player's tool to "%{_L::1}% MAX/MAX"
    47.                 else:
    48.                     set {_L::*} to uncolored lore of player's tool split at " "
    49.                     set {_A::*} to {_L::2} split at "/"
    50.                     set {_A::1} to {_A::1} parsed as number
    51.                     add {_EXP} to {_A::1}
    52.                     set {_A::2} to {_A::2} parsed as number
    53.                     if {_A::1} is more than or equal to {_A::2}:
    54.                         broadcast "LEVEL UP!"
    55.                         subtract {_A::2} from {_A::1}
    56.                         set {_A::2} to {_A::2}*3
    57.                         add 1 to {_r}
    58.                         set name of player's tool to "%{_N::1}%Level %{_R}%]"
    59.                     set lore of player's tool to "%{_L::1}% %{_A::1}%/%{_A::2}%"
    60.             delete {_r}
    61.             delete {_EXP}
    62.            
    63.            
    64. command /test:
    65.     trigger:
    66.         loop blocks in radius 2 around block above block at player:
    67.             y-coord of loop-block is y-coord of block above block at player
    68.             loop-block is not air
    69.             set {_block} to loop-block
    70.             broadcast "%{_block}%"
    71.            
    72. command /stick:
    73.     trigger:
    74.         give player stick named "Harvester [Level 1]" with lore "EXP: 0/100"
    75.  
    76. command /up:
    77.     executable by: players
    78.     trigger:
    79.         player is riding
    80.         "%player's vehicle%" is "boat"
    81.         block at player's vehicle is farmland
    82.         set {_boat} to player's vehicle
    83.         make player dismount any vehicle
    84.         teleport {_boat} to location of player
    85.         push {_boat} forwards at speed 0.5
    86.         push {_boat} upwards at speed 0.5
    87.         wait 2 ticks
    88.         make player ride {_boat}
    89.  
    90. on click with stick:
    91.     send "%target block%"
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Welcome to the "Party" :emoji_grinning: I can definitely use your suggestion! Maybe we can sell some keys and have an "upgrade" command to make your key better, like higher radius, more crops, faster speed, replant or no replant. Stuff like that :emoji_grinning:
    --- Double Post Merged, Mar 28, 2017, Original Post Date: Mar 21, 2017 ---
    I added some functions to clean up

    Full source on https://github.com/GeekWithAChick/FarmingSim

    Code (Skript):
    1. on vehicle enter:
    2.  
    3.     wait 1 tick
    4.     "%entity%" is "boat"
    5.  
    6.     while player is riding:
    7.         wait 5 ticks # Do not delete this line
    8.  
    9.         enableAutomaticStepUpFor(player)
    10.  
    11.         name of player's tool contains "Harvester"
    12.         set {_r} to "%getRadiusFromToolOf(player)%" parsed as number
    13.  
    14.         {_r} is more than 0
    15.         loop blocks in radius {_r} around block above block at player:
    16.  
    17.             y-coord of loop-block is y-coord of block above block at player # loop in a circle not sphere
    18.             loop-block is not air
    19.  
    20.             set {_block} to loop-block
    21.             set {_amount} to random number between 1 and 3
    22.  
    23.             if "%{_block}%" contains "wheat":
    24.                 data value of {_block} is 7
    25.                 set data value of block at {_block} to 0
    26.                 drop {_amount} of wheat at block at {_block}
    27.                 addExperienceToToolOf(player, 1)
    28.  
    29.             else if "%{_block}%" contains "carrot":
    30.                 data value of {_block} is 7
    31.                 set data value of block at {_block} to 0
    32.                 drop {_amount} of carrots at block at {_block}
    33.                 addExperienceToToolOf(player, 1)
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Looks interesting, I may look the repository and see what I can do.
     
    • Like Like x 1

Share This Page

Loading...