Solved Generator not working

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

SuperTommyDog

Member
Sep 2, 2019
14
0
1
I have tried to make a generator for a farming server it has 0 errors but:

- The message saying how many you have when you place one down is stuck at 0
- You can place over 20 generators
- The wheat wont spawn at all

I would be grateful if anyone could solve any of my problems (btw this is my first every post idk everything)

Code:
on join:
    set {genlimit::%player%} to 20
    set {gens::%player%} to 0

on place:
    if event-block is a hay_block:
        if name of player's tool is "&e&lWheat":
            if {gens::%player%} >= {genlimit::%player%}:
                send "&6&lGen &*>> &cYou cannot place over %{genlimit::%player%}% Generators!"
            else:
                add 1 to {gen::%player%}
                set location of event-block to {_loc}
                add 2 to the y-coordinate of {_loc}
                add {_loc} to {wheatgen::*}
                send "&6&lGen &8>> &aYou have succefully placed generator %{gens::%player%}%"

every 7 seconds:
    drop 1 wheat at {wheatgen::*}
 
Not sure about the wheat not spawning but for the generator count it's because you added 1 to {gen::%player%} and in the first part you put {gens::%player%}. Also if you set {gens::%player%} to 0 evertime they join it'll reset if they relog
 
ik about the on join thing its just for me to test and only add 1 word in when it works. Thanks though.

Also i had to change set location of event-block to {_loc} to
set {_loc} to location of event-block and now the wheat summon thing works.
 
Last edited:
Status
Not open for further replies.