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

Mike_20202

Member
Aug 24, 2021
1
0
1
24
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
 
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:
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::2::*}
                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
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%}
 
Status
Not open for further replies.