Solved gen upgrading

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

Zach20

Member
Apr 19, 2020
2
0
0
22
Hello! I'm Zach20 and i'm trying to figure out how to skript in a system where a player can upgrade a gen from tier 1 to tier 2, but i can't figure out how to remove the old gen and the cost of upgrading it from the player.
Skript Version: Skript 2.4
Skript Author: Bensku
Minecraft Version 1.15.2
here's my skript:
Code:
on left click:
  if player's held item is music disc 13:
    wait 1 tick
    open chest with 1 row named "&7&lStarter Gen" to player
    wait 1 tick
    format slot 6 of player with diamond named "&a&lUpgrade Gen" to close then run [execute console command "/1genupgrade %player%"]

command /1genupgrade <player>:
  trigger:
    if player has 128 cobblestone and 128 coal:
      give 1 music disc cat named "&9&lTier 2 Gen" to arg-1
      remove 128 cobblestone from arg-1
      remove 128 coal from arg-1
      remove music disc 13 from arg-1
    else:
      send "&c&lSorry! You dont have the resources to upgrade this gen!"

if anyone can help me on this, it would be much appreciated
 
Last edited:
Code:
command /1genupgrade <player>:
  trigger:
    if player's inventory contains 128 cobblestone and 128 coal:
      give arg-1 1 music disc cat named "&9&lTier 2 Gen"
      remove 128 cobblestone from arg-1's inventory
      remove 128 coal from arg-1's inventory
      remove music disc 13 from arg-1's inventory
    else:
      send "&c&lSorry! You dont have the resources to upgrade this gen!"

This should work :emoji_wink:
 
Code:
command /1genupgrade <player>:
  trigger:
    if player's inventory contains 128 cobblestone and 128 coal:
      give arg-1 1 music disc cat named "&9&lTier 2 Gen"
      remove 128 cobblestone from arg-1's inventory
      remove 128 coal from arg-1's inventory
      remove music disc 13 from arg-1's inventory
    else:
      send "&c&lSorry! You dont have the resources to upgrade this gen!"

This should work :emoji_wink:
Thank You so much! it works
 
Status
Not open for further replies.