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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Please help me with my script

Discussion in 'Skript' started by Mike_20202, Sep 1, 2022.

Thread Status:
Not open for further replies.
  1. Mike_20202

    Mike_20202 Member

    Joined:
    Aug 24, 2021
    Messages:
    1
    Likes Received:
    0
    Im trying to make a gen server with placeable gens but the upgrade from tier 1 to tier 2 does not work, i cant find out why it doesn't work

    on right click on white glazed terracotta:
    if player is sneaking:
    if {cooldown.%player%} is true:
    send "%{prefix}% Slow down!"
    cancel event
    stop
    if {cooldown.%player%} is false:
    if {money.%player%} is more than 99:
    set event-block to orange glazed terracotta
    send action bar "&3You upgraded your gen for 100 money" to player
    remove event-block's location from {white glazed terracotta.generator::1::*}
    add event-block's location to {orange glazed terracotta.generator::1::*}
    remove 100 from {money.%player%}
    else:
    send action bar "&cYou need 100 money to do this!" to player
    set {cooldown.%player%} to true
    wait 4 ticks
    set {cooldown.%player%} to false
     
  2. TweedeKamer

    TweedeKamer Member

    Joined:
    Sep 6, 2021
    Messages:
    25
    Likes Received:
    1
    Please format your code we cannot help you with code like this
     
  3. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    193
    Likes Received:
    28
    Because on line 12 you are adding location of event-block to {orange glazed terracotta.generator::1::*}
    But I think, tier 2 is {orange glazed terracotta.generator::2::*}
    Code (Text):
    1. on right click on white glazed terracotta:
    2.     if player is sneaking:
    3.         if {cooldown.%player%} is true:
    4.             send "%{prefix}% Slow down!"
    5.             cancel event
    6.             stop
    7.         if {cooldown.%player%} is false:
    8.             if {money.%player%} is more than 99:
    9.                 set event-block to orange glazed terracotta
    10.                 send action bar "&3You upgraded your gen for 100 money" to player
    11.                 remove event-block's location from {white glazed terracotta.generator::1::*}
    12.                 add event-block's location to {orange glazed terracotta.generator::2::*}
    13.                 remove 100 from {money.%player%}
    14.             else:
    15.                 send action bar "&cYou need 100 money to do this!" to player
    16.                 set {cooldown.%player%} to true
    17.                 wait 4 ticks
    18.                 set {cooldown.%player%} to false
    Better use index of list as location of block, and simply increment number value by index
    Something like:
    add 1 {orange glazed terracotta.generator::%location of event-block%}
    And don't use dot in lists, use
    {money::%uuid of player%}, instead {money.%player%}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...