Guest User

Christmas Gifts

a guest
Dec 6th, 2014
1,293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.78 KB | None | 0 0
  1. # Name: Christmas Gifts
  2. # Desc: Drop prezentow z blokow oraz otwieranie ich za pomoca nozyc
  3. # Version: 1.4
  4. # Updated: 6.12.2014
  5. # Authors: © 2014 Makhart
  6.  
  7. #--------------------------------------------------
  8. # SETTINGS
  9. #--------------------------------------------------
  10. Options:
  11.     # Z czego maja dropic prezenty (stone, dirt, cobblestone, grass)
  12.     # Nazwa swiata/mapy na ktorej maja dropic prezenty
  13.     # Szansa na drop prezentu (0.3 polecane na survival/hardcore, 1-2 dla serwerow latwych)
  14.     # Nick gracza ktorego skin glowy wyglada jak prezent (standardowo polecam CruXXx)
  15.     blocks: stone
  16.     worlds: sv
  17.     chance: 0.3
  18.     player: CruXXx
  19.  
  20.     # Powiadomienie dla gracza kiedy rozpakowywuje prezent
  21.     # Powiadomienie dla gracza kiedy dropnie prezent z bloku
  22.     otwarcie: &3Ciekawe co dostane..
  23.     wydrapia: &3Hol, hol, hol! Znalazles &6prezent
  24.  
  25.     # Standardowy item ktory dropi za kazdym razem
  26.     # (musisz wpisac profesjonalna nazwe przedmiotu lub jego ID)
  27.     item0: cookie named "&6Swiateczne ciastko"
  28.  
  29.     # Pozostale itemy oraz ich szanse dropu
  30.     # (musisz wpisac profesjonalna nazwe przedmiotu lub jego ID)
  31.     # (jesli chcesz ustawic wlasna nazwe wydropionemu przedmiotowi skorzystaj ze wzoru powyzej)
  32.     item1: 322:1
  33.     chance1: 6
  34.  
  35.     item2: 2 340
  36.     chance2: 8
  37.  
  38.     item3: 128 4
  39.     chance3: 15
  40.  
  41.     item4: 2 potion:16425
  42.     chance4: 5
  43.  
  44.     item5: 16 262
  45.     chance5: 7
  46.  
  47.     # Dodanie pieniedzy graczowi oraz szansa na to, po otworzeniu prezentu
  48.     money: 20
  49.     chancemoney: 10
  50.  
  51.     # Wygranie przez gracza uprawnienia/permission oraz szansa na to, po otworzeniu prezentu
  52.     permi: permission
  53.     chancepermi: 0
  54.  
  55. #--------------------------------------------------
  56. Variables:
  57.     {gifts} = true
  58.  
  59. #--------------------------------------------------
  60.  
  61. on mine of {@blocks}:
  62.     if world is "{@worlds}":
  63.         if player is holding any pickaxe:
  64.             chance of {@chance}%:
  65.                 if {gifts} is true:
  66.                     console command "give %player% 397:3 1 player:{@player} name:&cPrezent lore:&8Postaw_na_ziemii_w_bezpiecznym|&8miejscu,_a_nastepnie_kliknij_&7PPM|&8na_prezent_trzymajac_w_rece_norzyce|&8aby_zobaczyc_co_jest_w_srodku_:D|&cM&2e&cr&2r&cy_&2C&ch&2r&ci&2s&ct&2m&ca&2s"
  67.                     send "{@wydrapia}"
  68.                     stop
  69.                 else:
  70.                     stop
  71. on place of head:
  72.     if player is holding player head:
  73.         if name of player's tool is "&cPrezent":
  74.             play raw sound "random.pop" at player with pitch 1 volume 1
  75.             set {prezent.%location%} to location of event-block
  76.             stop
  77. on rightclick on head with shears:
  78.     if location of block is {prezent.%location%}:
  79.         delete {prezent.%location%}
  80.         play raw sound "mob.sheep.shear" at player with pitch 1 volume 1
  81.         set event-block to air
  82.         send "{@otwarcie}"
  83.         drop {@item0}
  84.         chance of {@chance1}%:
  85.             drop {@item1}
  86.         else:
  87.             chance of {@chance2}%:
  88.                 drop {@item2}
  89.             else:
  90.                 chance of {@chance3}%:
  91.                     drop {@item3}
  92.                 else:
  93.                     chance of {@chance4}%:
  94.                         drop {@item4}
  95.                     else:
  96.                         chance of {@chance5}%:
  97.                             drop {@item5}
  98.         chance of {@chancemoney}%:
  99.             console command "/eco give %player% {@money}"
  100.         else:
  101.             chance of {@chancepermi}%:
  102.                 console command "/pex user %player% add {@permi}"
  103.                 console command "/manuaddp %player% {@permi}"
  104.         wait 1 second
  105.         play raw sound "mob.villager.idle" at player with pitch 1 volume 1
  106.         stop
  107. on mine of head:
  108.     if location of block is {prezent.%location%}:
  109.         cancel event
  110.         set event-block to air
  111.         delete {prezent.%location%}
  112.         console command "give %player% 397:3 1 player:{@player} name:&cPrezent lore:&8Postaw_na_ziemii_w_bezpiecznym|&8miejscu,_a_nastepnie_kliknij_&7PPM|&8na_prezent_trzymajac_w_rece_norzyce|&8aby_zobaczyc_co_jest_w_srodku_:D|&cM&2e&cr&2r&cy_&2C&ch&2r&ci&2s&ct&2m&ca&2s"
  113.         stop
  114. on explode:
  115.     if entity is TNT or creeper:
  116.         loop blocks in radius 10:
  117.             if loop-block is head:
  118.                 if location of loop-block is {prezent.%location%}:
  119.                     delete {prezent.%location%}
  120.                     set loop-block to air
  121.  
  122. command /gifts [<text>] [<text>]:
  123.     aliases: prezenty, prezent, gift
  124.     trigger:
  125.         if arg 2 is not set:
  126.             if arg 1 is set:
  127.                 if argument 1 is "off":
  128.                     if player has permission "christmasgifts.command.off" or "christmasgifts.*":
  129.                         set {gifts} to false
  130.                         broadcast "&3Drop prezentow zostal wylaczony przez &6%player%"
  131.                         stop
  132.                     else:
  133.                         send "&cNie masz uprawnien do tej komendy!"
  134.                         stop
  135.                 if argument 1 is "on":
  136.                     if player has permission "christmasgifts.command.on" or "christmasgifts.*":
  137.                         set {gifts} to true
  138.                         broadcast "&3Drop prezentow zostal wlaczony przez &6%player%"
  139.                         stop       
  140.                     else:
  141.                         send "&cNie masz uprawnien do tej komendy!"
  142.                         stop
  143.                 if argument 1 is "help":
  144.                     if player has permission "christmasgifts.command.help" or "christmasgifts.*":
  145.                         send "&8=============== &cChristmas Gifts &8==============="
  146.                         send "&cM&2e&cr&2r&cy &2C&ch&2r&ci&2s&ct&2m&ca&2s"
  147.                         send "&8~Makhart"
  148.                         send "&c/prezent help &8- pokazuje komendy"
  149.                         send "&c/prezent &8- daje prezent"
  150.                         send "&c/prezent on &8- wlacza drop prezentow"
  151.                         send "&c/prezent off &8- wylacza drop prezentow"
  152.                         send "&c/prezent <nick> &8- daje prezent danemu graczowi"
  153.                         send "&c/prezent <nick <ilosc> &8- daje wybrana ilosc prezetow danemu graczowi"
  154.                         send "&8=============== &cChristmas Gifts &8==============="
  155.                         stop
  156.                     else:
  157.                         send "&cNie masz uprawnien do tej komendy!"
  158.                         stop
  159.                 if arg 1 is not "on" or "off" or "help":
  160.                     if player has permission "christmasgifts.command.give" or "christmasgifts.*":
  161.                         console command "give %arg 1% 397:3 1 player:{@player} name:&cPrezent lore:&8Postaw_na_ziemii_w_bezpiecznym|&8miejscu,_a_nastepnie_kliknij_&7PPM|&8na_prezent_trzymajac_w_rece_norzyce|&8aby_zobaczyc_co_jest_w_srodku_:D|&cM&2e&cr&2r&cy_&2C&ch&2r&ci&2s&ct&2m&ca&2s"
  162.                         send "&7Mikolaj podarowal prezent"
  163.                         stop
  164.                     else:
  165.                         send "&cNie masz uprawnien do tej komendy!"
  166.                         stop
  167.             else:
  168.                 if player has permission "christmasgifts.command.give" or "christmasgifts.*":
  169.                     console command "give %player% 397:3 1 player:{@player} name:&cPrezent lore:&8Postaw_na_ziemii_w_bezpiecznym|&8miejscu,_a_nastepnie_kliknij_&7PPM|&8na_prezent_trzymajac_w_rece_norzyce|&8aby_zobaczyc_co_jest_w_srodku_:D|&cM&2e&cr&2r&cy_&2C&ch&2r&ci&2s&ct&2m&ca&2s"
  170.                     send "&7Mikolaj podarowal prezent"
  171.                     stop
  172.                 else:
  173.                     send "&cNie masz uprawnien do tej komendy!"
  174.                     stop
  175.         else:
  176.             if arg 1 is set:
  177.                 if player has permission "christmasgifts.command.give" or "christmasgifts.*":
  178.                     console command "give %arg 1% 397:3 %arg 2% player:{@player} name:&cPrezent lore:&8Postaw_na_ziemii_w_bezpiecznym|&8miejscu,_a_nastepnie_kliknij_&7PPM|&8na_prezent_trzymajac_w_rece_norzyce|&8aby_zobaczyc_co_jest_w_srodku_:D|&cM&2e&cr&2r&cy_&2C&ch&2r&ci&2s&ct&2m&ca&2s"
  179.                     send "&7Mikolaj podarowal prezent"
  180.                     stop
  181.                 else:
  182.                     send "&cNie masz uprawnien do tej komendy!"
  183.                     stop
Advertisement
Add Comment
Please, Sign In to add comment