Weird bug

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

SuperTommyDog

Member
Sep 2, 2019
14
0
1
So these 3 generators work absolutely perfectly:

Code:
on right click:
    if event-block is hay_block:
        if player is sneaking:
            if player's balance is greater than or equal to 5000:
                set {_deleteloc} to location of block at event-block
                add 2 to the y-coordinate of {_deleteloc}
                remove {_deleteloc} from {wheatgen::*}
                add {_deleteloc} to {melongen::*}
                set event-block to melon
                remove 5000 from player's balance
                send player title "&6&l+1 Melon Generator" with subtitle "&6&lYou have upgraded a wheat generator!" for 3 seconds
            else:
                send "&6&lGen &8>> &cYou need $5,000 to do that!"
        else:
            send "&6&lGen &8>> &cYou must be shifting to do that!"

on right click:
    if event-block is melon:
        if player is sneaking:
            if player's balance is greater than or equal to 15000:
                set {_deleteloc} to location of block at event-block
                add 2 to the y-coordinate of {_deleteloc}
                remove {_deleteloc} from {melongen::*}
                add {_deleteloc} to {carrotgen::*}
                set event-block to orange_concrete
                remove 15000 from player's balance
                send player title "&6&l+1 Carrot Generator" with subtitle "&6&lYou have upgraded a melon generator!" for 3 seconds
            else:
                send "&6&lGen &8>> &cYou need $15,000 to do that!"
        else:
            send "&6&lGen &8>> &cYou must be shifting to do that!"

on right click:
    if event-block is orange_concrete:
        if player is sneaking:
            if player's balance is greater than or equal to 50000:
                set {_deleteloc} to location of block at event-block
                add 2 to the y-coordinate of {_deleteloc}
                remove {_deleteloc} from {carrotgen::*}
                add {_deleteloc} to {pumpkingen::*}
                set event-block to pumpkin
                remove 50000 from player's balance
                send player title "&6&l+1 Pumpkin Generator" with subtitle "&6&lYou have upgraded a carrot generator!" for 3 seconds
            else:
                send "&6&lGen &8>> &cYou need $50,000 to do that!"
        else:
            send "&6&lGen &8>> &cYou must be shifting to do that!"
But these 2 spawn the last few items as well as the ones they're meant to?

Code:
on right click:
    if event-block is pumpkin:
        if player is sneaking:
            if player's balance is greater than or equal to 75000:
                set {_deleteloc} to location of block at event-block
                add 2 to the y-coordinate of {_deleteloc}
                remove {_deleteloc} from {pumpkingen::*}
                add {_deleteloc} to {coalgen::*}
                set event-block to coal_block
                remove 75000 from player's balance
                send player title "&6&l+1 Coal Generator" with subtitle "&6&lYou have upgraded a Pumpkin  generator!" for 3 seconds
            else:
                send "&6&lGen &8>> &cYou need $75,000 to do that!"
        else:
            send "&6&lGen &8>> &cYou must be shifting to do that!"

on right click:
    if event-block is coal_block:
        if player is sneaking:
            if player's balance is greater than or equal to 100000:
                set {_deleteloc} to location of block at event-block
                add 2 to the y-coordinate of {_deleteloc}
                remove {_deleteloc} from {coalgen::*}
                add {_deleteloc} to {irongen::*}
                set event-block to iron_block
                remove 100000 from player's balance
                send player title "&6&l+1 Iron Generator" with subtitle "&6&lYou have upgraded a &8&LCoal generator!" for 3 seconds
            else:
                send "&6&lGen &8>> &cYou need $100,000 to do that!"
        else:
            send "&6&lGen &8>> &cYou must be shifting to do that!"
Because im stumped. It has 0 errors
 
Consider debugging your code when you run into 0 errors & it doesn't do what it's supposed to ^^
 
Status
Not open for further replies.