patison234

NPCSpeaker

Feb 9th, 2014
1,027
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.31 KB | None | 0 0
  1. # # # # # # # # # # # # # # # #
  2. # Script by PatisonPlayGames  #
  3. # Name: NPCSpeaker            #
  4. # Version: Beta 1.0           #
  5. # Skript: 2.0.2/2.1           #
  6. # # # # # # # # # # # # # # # #
  7.  
  8.  
  9.  
  10. #=============================================#
  11. #  Licencja NPCSpeaker by PatisonPlayGames!   #
  12. # + Nie zezwalam na:                          #
  13. # - Usuwanie tresci o autorze!                #
  14. # - Udostepnaniu skryptu innym!               #
  15. # - Podszywanie sie pod autora!               #
  16. # - Uzywanie kodu skryptu w swoich skryptach! #
  17. # - Zarabianie na skrypcie!                   #
  18. # + Zezwalam na:                              #
  19. # - Dodawanie kodu na swoja potrzebe!         #
  20. # - Modyfikowanie wiadomosci!                 #
  21. #=============================================#
  22.  
  23. options:
  24. # # # # # # # # # # # # # # #
  25. #                           #
  26. #       General Config      #
  27. #                           #
  28. # # # # # # # # # # # # # # #
  29.  
  30.  
  31.  
  32.     #Tag wyswietlany przed wiadomosciami skryptu:
  33.     tag: &8[&6NPCSpeaker&8]
  34.    
  35.     #Nazwa pliku sk.Zanim wgrasz plik i zmieniles nazwe zmien ja takze tutaj i dopiero wgraj plik!:
  36.     sk: NPCSpeaker
  37.    
  38.     #Komenda uzywana w skrypcie:
  39.     komenda: speaker
  40.    
  41.     #Skroty do komendy wyzej:
  42.     aliases: speaker, npc, npcspeaker
  43.    
  44.     #Tutaj podajemy co ile ma sie wyswietlac wiadomosc jak stoimy kolo npc (w sekundach):
  45.     time: 5
  46.  
  47.    
  48.    
  49. # # # # # # # # # # # # # # #
  50. #                           #
  51. #       Permission          #
  52. #                           #
  53. # # # # # # # # # # # # # # #
  54.  
  55.  
  56.  
  57.     # Wiadomosć przy braku permisji:
  58.     permission: &cNie posiadasz uprawnien!
  59.    
  60. # Skript Code
  61. variables:
  62.     {npcspeaker.setname.%player%} = false
  63.     {npcspeaker.setmessage.%player%} = false
  64.    
  65.    
  66. command /{@komenda} [<text>] [<text>]:
  67.     aliases: {@aliases}
  68.     trigger:
  69.         if arg 1 is not set:
  70.             send "&8====={@tag}&8======"
  71.             send "&6{@komenda} - &aPokazuje okno pomocy!"
  72.             send "&6{@komenda} setspawn [number] - &austawia spawn npc!"
  73.             send "&6{@komenda} usun [number] - &aUsuwa dany spawn!"
  74.             send "&6{@komenda} setmessage [message] - &a Ustawia wiadomosć dla npc!"
  75.             send "&6{@komenda} setname [name] - &aUstawia imię dla danego npc!"
  76.             send "&6{@komenda} autor - &aPokazuje autora oraz wersje skryptu!"
  77.             send "&6{@komenda} reload - &aPrzeladowywuje skrypt!"
  78.             stop
  79.         if arg 1 is "pomoc":
  80.             send "&8====={@tag}&8======"
  81.             send "&6{@komenda} - &aPokazuje okno pomocy!"
  82.             send "&6{@komenda} setspawn [number] - &austawia spawn npc!"
  83.             send "&6{@komenda} usun [number] - &aUsuwa dany spawn!"
  84.             send "&6{@komenda} setmessage [message] - &a Ustawia wiadomosć dla npc!"
  85.             send "&6{@komenda} setname [name] - &aUstawia imię dla danego npc!"
  86.             send "&6{@komenda} autor - &aPokazuje autora oraz wersje skryptu!"
  87.             send "&6{@komenda} reload - &aPrzeladowywuje skrypt!"
  88.             stop
  89.         if arg 1 is "setspawn":
  90.             if arg 2 parsed as number is set:
  91.                 if player has permission "npcspeaker.setspawn" or "npcspeaker.*":
  92.                     if {npcspeaker.available.%arg 2%} is true:
  93.                         send "{@tag} &cTen spawn jest juz w uzyciu!"
  94.                         stop
  95.                     else:
  96.                         add "%arg 2%" to {npcspeaker.list::*}
  97.                         set {npcspeaker.available.%arg 2%} to true
  98.                         set {npcspeaker.spawn.%arg 2%} to location of player
  99.                         spawn villager at {npcspeaker.spawn.%arg 2%}
  100.                         apply slowness 100 to the last spawned entity for 100 days
  101.                         set {npcspeaker.villager.%last spawned entity%.%arg 2%} to true
  102.                         send "{@tag} &aStworzono npc na spawnie &9%arg 2%"
  103.                         stop
  104.                 else:
  105.                     send "{@tag} {@permission}"
  106.                     stop
  107.             else:
  108.                 send "{@tag} &cPodaj numer spawna!"
  109.                 stop
  110.         if arg 1 is "usun":
  111.             if arg 2 parsed as number is set:
  112.                 if player has permission "npcspeaker.usun" or "npcspeaker.*":
  113.                     if {npcspeaker.available.%arg 2%} is set:
  114.                         remove "%arg 2%" from {npcspeaker.list::*}
  115.                         clear {npcspeaker.available.%arg 2%}
  116.                         clear {npcspeaker.spawn.%arg 2%}
  117.                         clear {npcspeaker.villager.%arg 2%}
  118.                         loop all villagers:
  119.                             if {npcspeaker.villager.%loop-villager%.%arg 2%} is true:
  120.                                 clear {npcspeaker.villager.%loop-villager%.%arg 2%}
  121.                                 clear {npcspeaker.%loop-villager%.msg}
  122.                                 kill loop-villager
  123.                         send "{@tag} &aUsunięto npc na spawnie &9%arg 2%"
  124.                         stop
  125.                     else:
  126.                         send "{@tag} &cNie ma takiego spawnu!"
  127.                         stop
  128.                 else:
  129.                     send "{@tag} {@permission}"
  130.                     stop
  131.             else:
  132.                 send "{@tag} &cPodaj numer spawna!"
  133.                 stop   
  134.         if arg 1 is "setname":
  135.             if arg 2 parsed as text is set:
  136.                 if player has permission "npcspeaker.setname" or "npcspeaker.*":
  137.                     if {npcspeaker.setname.%player%} is false:
  138.                         set {npcspeaker.%player%.name} to "%coloured arg 2%"
  139.                         set {npcspeaker.setname.%player%} to true
  140.                         send "{@tag} &aKliknij na npc by nadać imię!"
  141.                         stop
  142.                     else:
  143.                         send "{@tag}&cImie zostalo  juz wczesniej wybrane kliknij na danego npc!"
  144.                         stop
  145.                 else:
  146.                     send "{@tag} {@permission}"
  147.                     stop
  148.             else:
  149.                 send "{@tag} &cPodaj imie npc!"
  150.                 stop
  151.         if arg 1 is "reload":
  152.             if player has permission "npcspeaker.*" or "npcspeaker.reload":
  153.                 execute console command "/sk reload {@sk}"
  154.                 send "{@tag} &aPrzeladowano!"
  155.                 stop
  156.             else:
  157.                 send "{@tag} {@permission}"
  158.                 stop
  159.         if arg 1 is "autor":
  160.             send "&7----------------------------------------------"
  161.             send " &8Autor: &aPatisonPlayGames"
  162.             send " &8Nazwa: &aNPCSpeaker"
  163.             send "&8 &8&nYou&4&nTube:&a &nwww.youtube.com/PatisonPlayGames"
  164.             send "&7----------------------------------------------"
  165.             stop   
  166.         if arg 1 is "setmessage":
  167.             if arg 2 parsed as text is set:
  168.                 if player has permission "npcspeaker.setmessage" or "npcspeaker.*":                    
  169.                     if {npcspeaker.setmessage.%player%} is false:
  170.                         set {npcspeaker.%player%.message} to "%coloured arg 2%"
  171.                         set {npcspeaker.setmessage.%player%} to true
  172.                         send "{@tag} &aKliknij na npc by nadać wiadomosc!"
  173.                         stop
  174.  
  175.                     else:
  176.                         send "{@tag}&cWiadomosc zostala  juz wczesniej wybrana kliknij na danego npc!"
  177.                         stop
  178.                 else:
  179.                     send "{@tag} {@permission}"
  180.                     stop
  181.             else:
  182.                 send "{@tag} &cPodaj wiadomosc dla npc!"
  183.                 stop
  184.  
  185.  
  186. on rightclick on villager:
  187.     if {npcspeaker.setname.%player%} is true:
  188.         cancel event
  189.         set display name of the clicked entity to "%{npcspeaker.%player%.name}%"
  190.         clear {npcspeaker.setname.%player%}
  191.         clear {npcspeaker.%player%.name}
  192.         send "{@tag} &aNadano imię!"
  193.         stop
  194.     if {npcspeaker.setmessage.%player%} is true:
  195.         cancel event
  196.         clear {npcspeaker.setmessage.%player%}
  197.         send "{@tag} &aNadano wiadomość!"
  198.         set {npcspeaker.%targeted entity%.msg} to {npcspeaker.%player%.message}
  199.         send "{@tag} &aAktualna wiadomosc: %{npcspeaker.%targeted entity%.msg}%"
  200.         stop       
  201.  
  202. on damage of villager:
  203.     loop {npcspeaker.list::*}:
  204.         if {npcspeaker.villager.%victim%.%loop-value%} is true:
  205.             cancel event
  206.  
  207. every 1 ticks:
  208.     loop all villagers:
  209.         loop {npcspeaker.list::*}:
  210.             if {npcspeaker.villager.%loop-villager%.%loop-value%} is true:
  211.                 teleport loop-villager to {npcspeaker.spawn.%loop-value%}
  212.  
  213. every 1 seconds:
  214.     loop all players:
  215.         loop villagers in radius 5 around loop-player:
  216.             if {npcspeaker.%loop-villager%.msg} is set:
  217.                 set {_czas} to difference between {czas.%loop-player%} and now
  218.                 if {_czas} is less than {@time} seconds:
  219.                     stop
  220.                 else:
  221.                     send "%{npcspeaker.%loop-villager%.msg}%" to loop-player
  222.                     set {czas.%loop-player%} to now
  223.  
  224. on skript start:
  225.     send "&8NPCSpeaker wymaga wersji Skript 2.0.2/2.1 ..." to the console
  226.     wait 1 seconds
  227.     send "&8Serwer pracuje na wersji: %skript version%" to the console
  228.     send "" to the console
  229.     send "&8--------------------------------------------------------------" to the console
  230.     send "&8|                                                            |" to the console
  231.     send "&8|                  Enable &9NPCSpeaker                     &8|" to the console
  232.     send "&8|                                                            |" to the console
  233.     send "&8--------------------------------------------------------------" to the console
  234.     send "" to the console
  235.     send "&8Autor: &ePatisonPlayGames" to the console
  236.     send "" to the console
  237.  
  238.  
  239. #------------------------------------------------ End of Script / Thanks for Use ---------------------------------#
  240. #-------------------------------- © by PationPlayGames - Author / YouTube www.youtube.com/PatisonPlayGames -------#
Advertisement
Add Comment
Please, Sign In to add comment