L0v0lup

Skript✎ Items im YAML speichern/auslesen (Votecrate) 📷#136 Tutorial

Aug 7th, 2020 (edited)
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. options:
  2.     Voteitem: music disc named "&6Lootbox Chip" with lore "&fStecke den Coin in die Musikbox am Spawn"
  3.  
  4. command /coin:
  5.     permission: admin
  6.     trigger:
  7.         give player {@Voteitem}
  8.  
  9. command /voteitem:
  10.     permission: admin
  11.     trigger:
  12.         add player's tool to skript-yaml list "Votecrate" from "plugins/Config/Votecrate.yml"
  13.         save yaml "plugins/Config/Votecrate.yml"
  14.         load yaml "plugins/Config/Votecrate.yml" as "plugins/Config/Votecrate.yml"
  15.         send "&c%player's tool% &azum Votecrate hinzugefügt."
  16.  
  17. on vote:
  18.     add 1 to {Votes::%event-player%}
  19.     add 1 to {Votes.Voteparty}
  20.     give event-player {@Voteitem}
  21.     Voteparty()
  22.     loop all players:
  23.         Scoreboard(loop-player)
  24.     broadcast "&2&lVKTR &8» &a+1 Vote: &7%player% &6(/vote)"
  25.     send "&a+1 Votechip"
  26.  
  27. on rightclick on jukebox:
  28.     "%region at event-block%" is "jukebox in world world and spawn in world world"
  29.     if player's tool is {@Voteitem}:
  30.         cancel event
  31.         set {_item::*} to skript-yaml list "Votecrate" from "plugins/Config/Votecrate.yml"
  32.         open chest with 1 row named "&cVotecrate" to player
  33.         set metadata tag "CrateGui" of player to player's current inventory
  34.         set {Votegui.%player%} to true
  35.         set {_turns} to 20
  36.         set {_wait} to 1 ticks
  37.         loop {_item::*}:
  38.             add random element out of {_item::*} to {_item2::*}
  39.             remove {_item2::*} from {_item::*}
  40.         set {_item::*} to {_item2::*}
  41.         while {Votegui.%player%} is true:
  42.             loop {_item::*}:
  43.                 set {_clone_%{_size}%} to loop-value
  44.                 add 1 to {_size}
  45.                 {_size} is 18:
  46.                     set {_size} to 0
  47.             loop 9 times:
  48.                 set {_name} to loop-number -1
  49.                 set slot {_name} of player's current inventory to {_clone_%{_name}%}
  50.             subtract 1 from {_turns}
  51.             play "UI_BUTTON_CLICK" to player at volume 1
  52.             {_turns} = 0:
  53.                 play "ENTITY_PLAYER_LEVELUP" to player at volume 1
  54.                 give player {_clone_4}
  55.                 remove player's tool from player's inventory
  56.                 stop loop
  57.             add 1 ticks to {_wait}
  58.             wait {_wait}
  59.        
  60.         set {_c1} to 4
  61.         set {_c2} to 4
  62.         wait 2 seconds
  63.         loop 5 times:
  64.             {Votegui.%player%} is true:
  65.                 set slot {_c1} of player's current inventory to green stained glass pane named " "
  66.                 set slot {_c2} of player's current inventory to green stained glass pane named " "
  67.                 add 1 to {_c1}
  68.                 subtract 1 from {_c2}
  69.                 play "BLOCK_LAVA_EXTINGUISH" to player at volume 1
  70.                 wait 5 ticks
  71.             else:
  72.                 stop
  73.        
  74.         set {_c1} to 8
  75.         set {_c2} to 0
  76.         loop 4 times:
  77.             {Votegui.%player%} is true:
  78.                 set slot {_c1} of player's current inventory to red stained glass pane named " "
  79.                 set slot {_c2} of player's current inventory to red stained glass pane named " "
  80.                 add 1 to {_c2}
  81.                 subtract 1 from {_c1}
  82.                 play "BLOCK_LAVA_EXTINGUISH" to player at volume 1
  83.                 wait 5 ticks
  84.             else:
  85.                 stop
  86.         {_clone_4} is not air:
  87.             {Votegui.%player%} is true     
  88.             set slot 4 of player's current inventory to {_clone_4} named "&cDein Gewinn"
  89.         else:
  90.             {Votegui.%player%} is true:
  91.             set slot 4 of player's current inventory to barrier named "&4Du hast nichts gewonnen"
  92.         wait 5 seconds
  93.         stop
  94.     else:
  95.         player's tool is music disc
  96.         remove player's tool from player's inventory
  97.         stop
  98.  
  99. on inventory click:
  100.     if event-inventory is metadata tag "CrateGui" of player:
  101.         cancel event
  102.     if {Votegui.%player%} is true:
  103.         cancel event
  104.  
  105. on drop:
  106.     if {Votegui.%player%} is true:
  107.         cancel event
  108.  
  109. on login:
  110.     set {Votegui.%player%} to false
  111.  
  112. on inventory close:
  113.     set {Votegui.%player%} to false
Add Comment
Please, Sign In to add comment