moeycvbn12

Untitled

Nov 29th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.26 KB | None | 0 0
  1. # |
  2. # █████▒ ▄▄▄ ███▄ ▄███▓ ██▓ ██▓ ██▓▓█████ ██▀███ ██████ |
  3. # ▓██ ▒ ▒████▄ ▓██▒▀█▀ ██▒▓██▒▓██▒ ▓██▒▓█ ▀ ▓██ ▒ ██▒▒██ ▒ |
  4. # ▒████ ░ ▒██ ▀█▄ ▓██ ▓██░▒██▒▒██░ ▒██▒▒███ ▓██ ░▄█ ▒░ ▓██▄ |
  5. # ░▓█▒ ░ ░██▄▄▄▄██ ▒██ ▒██ ░██░▒██░ ░██░▒▓█ ▄ ▒██▀▀█▄ ▒ ██▒ |
  6. # ░▒█░ ▓█ ▓██▒▒██▒ ░██▒░██░░██████▒░██░░▒████▒░██▓ ▒██▒▒██████▒▒ |
  7. # ▒ ░ ▒▒ ▓▒█░░ ▒░ ░ ░░▓ ░ ▒░▓ ░░▓ ░░ ▒░ ░░ ▒▓ ░▒▓░▒ ▒▓▒ ▒ ░ |
  8. # ░ ▒ ▒▒ ░░ ░ ░ ▒ ░░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░▒ ░ ▒░░ ░▒ ░ ░ |
  9. # ░ ░ ░ ▒ ░ ░ ▒ ░ ░ ░ ▒ ░ ░ ░░ ░ ░ ░ ░ |
  10. # ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ |
  11. # |
  12. #---------------------------------------------------------------------------------------------------------------------------|
  13. # |
  14. # INFORMATIONS DU SKRIPT = |
  15. #
  16. # ✪ Auteur = Mikioul
  17. # ➔ Version = 1.7 - (26/11/2017)
  18. # ➔ Type = Cosmetics pour serveur Minecraft (mini jeux de préférence)
  19. #
  20. # ➔ Versions Minecraft (testées !): |
  21. # ■ 1.8 = ✔
  22. # ■ 1.9 = ✔
  23. # ■ 1.10 = ✔
  24. # ■ 1.11 = ✔
  25. # ■ 1.12 = ✔ ( dernière version de SkStuff !)
  26. #
  27. # ➔ Addons (100 % fonctionnels !): |
  28. # ■ Skquery = https://dl.skmirror.pw/SkQuery_3.5.9-Lime.jar
  29. # ■ SkStuff = https://dl.skmirror.pw/SkStuff_1.6.4.1-fork-1.12.jar
  30. # ■ Tuske = https://dl.skmirror.pw/TuSKe_1.8.jar
  31. # ■ Skelett= https://dl.skmirror.pw/skUtilities_0.8.9.jar
  32. # ■ skript-yaml https://dl.skmirror.pw/skript-yaml_1.0.5.jar
  33. #
  34. # ➔ Tutos + Listes: |
  35. # ■ Ajouter une animation = https://github.com/Mikheull/Familier/wiki/Tuto---Ajout-d'animations
  36. # ■ Créer un familier = https://github.com/Mikheull/Familier/wiki/Tuto---Creation-de-familier
  37. # ■ Configurer le skript = https://github.com/Mikheull/Familier/wiki/Tuto---Config
  38. # ■ Installer le skript = https://github.com/Mikheull/Familier/wiki/Tuto---Installation
  39. # ■ familiers = https://github.com/Mikheull/Familier/blob/master/Familier-List
  40. # ■ animations = https://github.com/Mikheull/Familier/blob/master/Animation-List
  41. #
  42. # ➔ Github = https://github.com/Mikheull/Familier
  43. # ➔ Lien Skript-mc = https://skript-mc.fr/forum/resources/familiers.1185/
  44. # ➔ Me signaler un problème = https://skript-mc.fr/forum/conversations/add?to=Mikioul ---- > [SUPPORT FR]
  45. # ➔ Rejoindre mon discord = https://discordapp.com/invite/YEFhm3A
  46. # ➔ N'hésitez surtout pas a aller donner votre avis sur ma ressource
  47. # ➔ Merci a BrothersGame pour la traduction en Espagnol
  48. # ➔ Merci a Polymeth pour la traduction en Anglais (en attente)
  49. # |
  50. #---------------------------------------------------------------------------------------------------------------------------|
  51. # |
  52.  
  53. options:
  54.  
  55. #⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊|
  56. # SAUVEGARDES | ➔ Endroit où sont stockés les têtes customs, merci de ne pas y toucher !
  57. #⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊|
  58.  
  59. Red: {display:{Name:""&3» &c&oRouge""},SkullOwner:{Id:""27b2c930-daca-4574-a51b-df4f3332396e"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2Y0NmMzMWQ2ZWU2ZWE2MTlmNzJlNzg1MjMyY2IwNDhhYjI3MDQ2MmRiMGNiMTQ1NDUxNDQzNjI1MWMxYSJ9fX0=""}]}}}
  60. Green: {display:{Name:""&3» &a&oVert""},SkullOwner:{Id:""c8fee7ee-b067-48cb-80c8-337a63edd0b1"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzZmNjlmN2I3NTM4YjQxZGMzNDM5ZjM2NThhYmJkNTlmYWNjYTM2NmYxOTBiY2YxZDZkMGEwMjZjOGY5NiJ9fX0=""}]}}}
  61. Blue: {display:{Name:""&3» &b&oBleu""},SkullOwner:{Id:""0d2d7296-5e2e-409e-8d15-c01c8229b83d"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzk2NTQwY2U3NjIxMjVlMzk4Y2E1M2Q0Y2Q5YjY2ODM5NmQwNDY3ZTEyOGIzMGRhNWFhNjJiZTljZTA2MCJ9fX0=""}]}}}
  62. Arrow Left: {display:{Name:""&6&l« &ePage Précédente""},SkullOwner:{Id:""63dcc361-6c3e-42ed-87ec-01c356c8a6d9"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzM3NjQ4YWU3YTU2NGE1Mjg3NzkyYjA1ZmFjNzljNmI2YmQ0N2Y2MTZhNTU5Y2U4YjU0M2U2OTQ3MjM1YmNlIn19fQ==""}]}}}
  63. Arrow Right: {display:{Name:""&6&l» &ePage Suivante""},SkullOwner:{Id:""69e2e99e-7009-440e-a6d1-75b1c2ca5b6a"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWE0ZjY4YzhmYjI3OWU1MGFiNzg2ZjlmYTU0Yzg4Y2E0ZWNmZTFlYjVmZDVmMGMzOGM1NGM5YjFjNzIwM2Q3YSJ9fX0=""}]}}}
  64. settings: {display:{Name:""&eRéglages""},SkullOwner:{Id:""5f1bf5f7-5910-45d6-8fff-2e6d0730793e"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWZjNmVjM2I3NTM1NGI0OTIyMmE4OWM2NjNjNGFjYWQ1MjY0ZmI5NzdjYWUyNmYwYjU0ODNhNTk5YzQ2NCJ9fX0=""}]}}}
  65.  
  66. #⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊|
  67. # CODE | ➔ Cette partie concerne le développement du skript, Vous pouvez y toucher seulement si vous vous y connaissez un minimum, attention avec les mise a jour, elles pourraient effacer vos modifications
  68. #⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊|
  69.  
  70.  
  71. # [ ✚ ] = Loader + Mise a jour
  72. #-------------------------------------------------------------------------------------------------------------------------------- |
  73. function MikaFamilierYamlValue(p: player, t: text, f: text) :: string:
  74.  
  75. if {_f} is "familiers/config":
  76. set {_result} to yaml value "%{_t}%" from "familiers/config"
  77. if {_f} is "lang":
  78. set {_result} to yaml value "%{_t}%" from "familiers/lang/%{language.%{_p}%}%"
  79.  
  80. replace all "[PLAYER]" in {_result} with "%{_p}%"
  81. set {_x} to yaml value "prefix.g_prefix" from "familiers/config"
  82. replace all "[PREFIX]" in {_result} with "%{_x}%"
  83. set {_x} to yaml value "prefix.gui_prefix" from "familiers/config"
  84. replace all "[GUI_PREFIX]" in {_result} with "%{_x}%"
  85.  
  86. set {_x} to yaml value "options.FamilierNameMaxLength" from "familiers/config"
  87. replace all "[FamilierNameMaxLength]" in {_result} with "%{_x}%"
  88. replace all "[PAGE]" in {_result} with ""
  89.  
  90. return colored {_result}
  91.  
  92. function MikaFamilierYamlLoad(p: player):
  93. set {_s} to now
  94. if dir "plugins/Skript/scripts/familiers" does not exist:
  95. create dir "plugins/Skript/scripts/familiers"
  96. if dir "plugins/Skript/scripts/familiers/lang" does not exist:
  97. create dir "plugins/Skript/scripts/familiers/lang"
  98.  
  99. if file "plugins/Skript/scripts/familiers/lang/fr.yml" does not exist:
  100. download from "https://raw.githubusercontent.com/Mikheull/Familier/lang/fr.yml" to "plugins/Skript/scripts/familiers/lang/fr.yml"
  101. if file "plugins/Skript/scripts/familiers/lang/en.yml" does not exist:
  102. download from "https://raw.githubusercontent.com/Mikheull/Familier/lang/en.yml" to "plugins/Skript/scripts/familiers/lang/en.yml"
  103. if file "plugins/Skript/scripts/familiers/lang/es.yml" does not exist:
  104. download from "https://raw.githubusercontent.com/Mikheull/Familier/lang/es.yml" to "plugins/Skript/scripts/familiers/lang/es.yml"
  105.  
  106. if file "plugins/Skript/scripts/familiers/config.yml" does not exist:
  107. download from "https://raw.githubusercontent.com/Mikheull/Familier/lang/config.yml" to "plugins/Skript/scripts/familiers/config.yml"
  108. if file "plugins/Skript/scripts/familiers/fam.yml" does not exist:
  109. download from "https://raw.githubusercontent.com/Mikheull/Familier/lang/fam.yml" to "plugins/Skript/scripts/familiers/fam.yml"
  110.  
  111.  
  112. delete {language::familier::list::*}
  113. set {_files::*} to files in directory "plugins/Skript/scripts/familiers/lang/"
  114. loop {_files::*}:
  115. set {_res::*} to loop-value split at "lang/"
  116. if {_res::2} contains ".yml":
  117. replace all ".yml" in {_res::2} with ""
  118. add "%{_res::2}%" to {language::familier::list::*}
  119.  
  120. loop {language::familier::list::*}:
  121. load yaml "plugins/Skript/scripts/familiers/lang/%loop-value%.yml" as "familiers/lang/%loop-value%"
  122.  
  123. load yaml "plugins/Skript/scripts/familiers/config.yml" as "familiers/config"
  124. load yaml "plugins/Skript/scripts/familiers/fam.yml" as "familiers/data"
  125.  
  126. set {_c} to 1
  127. set {_x} to true
  128. while {_x} is true:
  129. delete {_a}
  130. set {_a} to (yaml value "%{_c}%.id" from "familiers/data")
  131. if {_a} is set:
  132. add 1 to {_c}
  133. else:
  134. set {_x} to false
  135. set {familiers::list-all} to {_c}
  136.  
  137. show an action bar from "&aLa configuration a été rechargée en &c% difference between {_s} and now% -- Version %MikaFamilierYamlValue({_p}, ""update.version"", ""familiers/config"")%" to all ops
  138.  
  139.  
  140. on join:
  141. if yaml "familiers/config" is not loaded:
  142. MikaFamilierYamlLoad(player)
  143.  
  144. if {language.%player%} is not set:
  145. set {language.%player%} to "%MikaFamilierYamlValue(player, ""langage.defaut"", ""familiers/config"")%"
  146.  
  147. if (yaml value "update.CheckVersion" from "familiers/config") is true:
  148. if player have permission "familier.update" or "familier.*":
  149. if text from "https://raw.githubusercontent.com/Mikheull/Familier/master/Version" isn't (yaml value "update.version" from "familiers/config"):
  150. send "%MikaFamilierYamlValue(player, ""update.update-available"", ""lang"")% %nl% &cLIEN = &fhttps://skript-mc.fr/forum/resources/familiers.1185/" to player
  151.  
  152. # [ ✚ ] = Commande Principale
  153. #-------------------------------------------------------------------------------------------------------------------------------- |
  154. command /familiers [<text>] [<text>]:
  155. aliases: familier, fam
  156. trigger:
  157. if player has permission "familier.use" or "familier.*":
  158. if arg 1 is not set:
  159. Familiers(player, "1")
  160. if arg 1 is "lang" or "langage" or "language" or "langue":
  161. if "%{language::familier::list::*}%" contains "%arg-2%":
  162. set {language.%player%} to "%arg-2%"
  163. send "%MikaFamilierYamlValue(player, ""langage.set"", ""lang"")%" to player
  164. else:
  165. send "%MikaFamilierYamlValue(player, ""langage.no-valid"", ""lang"")% %nl%&c%{language::familier::list::*}%" to player
  166. if arg 1 is "help":
  167. send "%MikaFamilierYamlValue(player, ""help.line-1"", ""lang"")% %nl% %MikaFamilierYamlValue(player, ""help.line-2"", ""lang"")% %nl% %nl% %MikaFamilierYamlValue(player, ""help.line-3"", ""lang"")% %nl% %nl% %MikaFamilierYamlValue(player, ""help.line-4"", ""lang"")% %nl% %MikaFamilierYamlValue(player, ""help.line-5"", ""lang"")%" to player
  168. if arg 1 is "load":
  169. if player has permission "familier.*":
  170. MikaFamilierYamlLoad(player)
  171.  
  172. if arg 1 is "rename":
  173. if arg 2 is set:
  174. if {Familiers::player::Status::%player%} is set:
  175. if length of the string argument-2 <= (yaml value "options.FamilierNameMaxLength" from "familiers/config"):
  176. loop all entities in radius 5 of player:
  177. if {Familiers::player::owner::%loop-entity%} is "%player%":
  178. add "{CustomNameVisible:1,CustomName:%colored arg-2%}" to nbt of loop-entity
  179. else:
  180. send "%MikaFamilierYamlValue(player, ""error.length-error"", ""lang"")%" to player
  181. else:
  182. send "%MikaFamilierYamlValue(player, ""error.dont-have-familier"", ""lang"")%" to player
  183. else:
  184. send "%MikaFamilierYamlValue(player, ""error.no-name"", ""lang"")%" to player
  185. else:
  186. show an action bar from "%MikaFamilierYamlValue(player, ""error.no-permission"", ""lang"")%" to player
  187.  
  188. # [ ✚ ] = PARTIE FAMILIERS MENU | ➔ Functions
  189. #-------------------------------------------------------------------------------------------------------------------------------- |
  190.  
  191. function Familiers(p: player ,page: text):
  192. loop all entities in radius 5 of {_p}:
  193. if {Familiers::player::owner::%loop-entity%} is "%{_p}%":
  194. set {_entity} to loop-entity
  195.  
  196. set {_page} to ({_page} parsed as number)
  197.  
  198. set {_count} to {familiers::list-all}
  199.  
  200. set {_allelements} to {_count}
  201. set {_pageCount} to 1
  202.  
  203. while {_allelements} >= 36:
  204. remove 36 from {_allelements}
  205. add 1 to {_pageCount}
  206.  
  207. if {_page} <= {_pageCount}:
  208. open chest with 6 rows named "%MikaFamilierYamlValue({_p}, ""gui.main.Gui-name"", ""lang"")% &7%{_page}%&f&l/&8%{_pageCount}%" to {_p}
  209. if {_page} >= 2:
  210. format gui slot 48 of {_p} with player head with custom nbt "{@Arrow Left}" named "%MikaFamilierYamlValue({_p}, ""gui.main.items.to-left.name"", ""lang"")%" to run:
  211. set {_page} to ({_page} parsed as number)
  212. set {_page} to ({_page} - 1)
  213. Familiers({_p}, "%{_page}%")
  214. if {_page} < {_pageCount}:
  215. format gui slot 50 of {_p} with player head with custom nbt "{@Arrow Right}" named "%MikaFamilierYamlValue({_p}, ""gui.main.items.to-right.name"", ""lang"")%" to run:
  216. set {_page} to ({_page} parsed as number)
  217. set {_page} to ({_page} + 1)
  218. Familiers({_p}, "%{_page}%")
  219.  
  220. loop {_count} times:
  221. set {_id} to (yaml value "%loop-number%.id" from "familiers/data")
  222. add "%{_id}%" to {_vartemp::*}
  223.  
  224. loop {_pageCount} times:
  225. loop {_vartemp::*}:
  226. if size of {_page.%loop-number-1%::*} < 36:
  227. add loop-value-2 to {_page.%loop-number-1%::*}
  228. remove loop-value-2 from {_vartemp::*}
  229.  
  230. set {_slot} to 0
  231. if {_page} > 1:
  232. set {_x} to {_page} - 1
  233. set {_s} to (36 * {_x})
  234. else:
  235. set {_s} to 1
  236. loop {_page.%{_page}%::*}:
  237. if (yaml value "%{_s}%.type" from "familiers/data") is "armor":
  238. set {_m} to "armor"
  239. else:
  240. set {_m} to "only-head"
  241. set {_skul} to (yaml value "%{_s}%.skull" from "familiers/data")
  242. set {_chestplate} to (yaml value "%{_s}%.chestplate" from "familiers/data")
  243. set {_legging} to (yaml value "%{_s}%.legging" from "familiers/data")
  244. set {_boot} to (yaml value "%{_s}%.boot" from "familiers/data")
  245. set {_id} to (yaml value "%{_s}%.id" from "familiers/data")
  246.  
  247. format gui slot {_slot} of {_p} with player head with custom nbt "%colored {_skul}%" to run function FamiliersSpawn({_p}, "%{_s}%","%{_id}%")
  248. # with lore "&cID = &f%{_id}%||||&cChesplate = &f%{_chestplate}%||&cLegging = &f%{_legging}%||&cBoot = &f%{_boot}%||||&cType = &f%{_m}%"
  249. add 1 to {_slot}
  250. add 1 to {_s}
  251.  
  252. format gui slot 40 of {_p} with skull of {_p} to run function FamiliersSpawn({_p}, "x","player")
  253. format gui slot 46 of {_p} with tripwire_hook named "%MikaFamilierYamlValue({_p}, ""gui.main.items.settings.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.main.items.settings.lore"", ""lang"")%" to close:
  254. if (yaml value "options.FamilierOptions" from "familiers/config") is "perso":
  255. FamiliersSettingsGui({_p})
  256. else:
  257. show an action bar from "%MikaFamilierYamlValue(player, ""error.global-config"", ""lang"")%" to player
  258. format gui slot 49 of {_p} with barrier named "%MikaFamilierYamlValue({_p}, ""gui.main.items.remove.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.main.items.remove.lore"", ""lang"")%" to close:
  259. loop all entities in radius 3 of {_p}:
  260. if {Familiers::player::owner::%loop-entity%} is "%{_p}%":
  261. set {_entity} to loop-entity
  262. kill {_entity}
  263. delete {Familiers::player::Status::%{_p}%}
  264. # format gui slot 52 of {_p} with hopper named "%MikaFamilierYamlValue({_p}, ""gui.main.items.sort.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.main.items.sort.lore"", ""lang"")%" to do nothing
  265. # format gui slot 53 of {_p} with daylight_sensor named "&cAjouter une animation" with lore "" to do nothing
  266.  
  267.  
  268.  
  269. function FamiliersSettingsGui(p: player):
  270. loop all entities in radius 3 of {_p}:
  271. if {Familiers::player::owner::%loop-entity%} is "%{_p}%":
  272. set {_entity} to loop-entity
  273.  
  274. open chest with 6 rows named "%MikaFamilierYamlValue({_p}, ""gui.settings.Gui-name"", ""lang"")%" to {_p}
  275.  
  276. if {Familiers::player::Status::%{_p}%} is not set:
  277. format gui slot 10 of {_p} with barrier named "%MikaFamilierYamlValue({_p}, ""gui.settings.rename.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.lore-error"", ""lang"")%" to do nothing
  278. else:
  279. if {_p} has permission "familier.config.rename" or "familier.config.*" or "familier.*":
  280. format gui slot 10 of {_p} with anvil named "%MikaFamilierYamlValue({_p}, ""gui.settings.rename.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.rename.lore"", ""lang"")%" to close:
  281. set {lockchat.familier.%{_p}%} to "rename"
  282. while {lockchat.familier.%{_p}%} is "rename":
  283. show an action bar from "%MikaFamilierYamlValue({_p}, ""request.msg"", ""lang"")%" to {_p}
  284. wait 1 second
  285. else:
  286. show an action bar from "%MikaFamilierYamlValue({_p}, ""error.no-permission"", ""lang"")%" to {_p}
  287.  
  288. if {Familiers::config::player::%{_p}%::tool-change} is set:
  289. format gui slot 19 of {_p} with diamond pickaxe with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.tool-change.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.tool-change.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-true"", ""lang"")%" to run function SettingsFamiliers({_p}, "tool-change", "false")
  290. else:
  291. format gui slot 19 of {_p} with diamond pickaxe with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.tool-change.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.tool-change.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-false"", ""lang"")%" to run function SettingsFamiliers({_p}, "tool-change", "true")
  292.  
  293. if {Familiers::config::player::%{_p}%::attack} is set:
  294. format gui slot 20 of {_p} with wooden sword with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.attack.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.attack.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-true"", ""lang"")%" to run function SettingsFamiliers({_p}, "attack", "false")
  295. else:
  296. format gui slot 20 of {_p} with wooden sword with no nbt with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.attack.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.attack.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-false"", ""lang"")%" to run function SettingsFamiliers({_p}, "attack", "true")
  297.  
  298. if {Familiers::config::player::%{_p}%::jump} is set:
  299. format gui slot 28 of {_p} with slime block named "%MikaFamilierYamlValue({_p}, ""gui.settings.jump.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.jump.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-true"", ""lang"")%" to run function SettingsFamiliers({_p}, "jump", "false")
  300. else:
  301. format gui slot 28 of {_p} with slime block named "%MikaFamilierYamlValue({_p}, ""gui.settings.jump.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.jump.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-false"", ""lang"")%" to run function SettingsFamiliers({_p}, "jump", "true")
  302.  
  303. if {Familiers::config::player::%{_p}%::sneak} is set:
  304. format gui slot 29 of {_p} with ladder named "%MikaFamilierYamlValue({_p}, ""gui.settings.sneak.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.sneak.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-true"", ""lang"")%" to run function SettingsFamiliers({_p}, "sneak", "false")
  305. else:
  306. format gui slot 29 of {_p} with ladder named "%MikaFamilierYamlValue({_p}, ""gui.settings.sneak.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.sneak.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-false"", ""lang"")%" to run function SettingsFamiliers({_p}, "sneak", "true")
  307.  
  308. if {Familiers::config::player::%{_p}%::bras} is set:
  309. format gui slot 37 of {_p} with stick named "%MikaFamilierYamlValue({_p}, ""gui.settings.bras.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.bras.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-true"", ""lang"")%" to run function SettingsFamiliers({_p}, "bras", "false")
  310. else:
  311. format gui slot 37 of {_p} with stick named "%MikaFamilierYamlValue({_p}, ""gui.settings.bras.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.bras.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-false"", ""lang"")%" to run function SettingsFamiliers({_p}, "bras", "true")
  312.  
  313. if {Familiers::config::player::%{_p}%::vue} is set:
  314. format gui slot 38 of {_p} with chainmail helmet with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.view.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.view.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-true"", ""lang"")%" to run function SettingsFamiliers({_p}, "vue", "false")
  315. else:
  316. format gui slot 38 of {_p} with chainmail helmet with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.view.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.view.lore"", ""lang"")% %MikaFamilierYamlValue({_p}, ""gui.settings.use-false"", ""lang"")%" to run function SettingsFamiliers({_p}, "vue", "true")
  317.  
  318. if {Familiers::player::Status::%{_p}%} is not set:
  319. format gui slot 14 of {_p} with barrier named "%MikaFamilierYamlValue({_p}, ""gui.settings.helmet.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.lore-error"", ""lang"")%" to do nothing
  320. format gui slot 23 of {_p} with barrier named "%MikaFamilierYamlValue({_p}, ""gui.settings.chestplate.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.lore-error"", ""lang"")%" to do nothing
  321. format gui slot 32 of {_p} with barrier named "%MikaFamilierYamlValue({_p}, ""gui.settings.legging.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.lore-error"", ""lang"")%" to do nothing
  322. format gui slot 41 of {_p} with barrier named "%MikaFamilierYamlValue({_p}, ""gui.settings.boot.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.lore-error"", ""lang"")%" to do nothing
  323.  
  324. else:
  325. format gui slot 14 of {_p} with helmet of {_entity} named "%MikaFamilierYamlValue({_p}, ""gui.settings.helmet.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.helmet.lore"", ""lang"")%" to close:
  326. if {_p} has permission "familier.config.stuff" or "familier.config.*" or "familier.*":
  327. set {lockchat.familier.%{_p}%} to "head"
  328. while {lockchat.familier.%{_p}%} is "head":
  329. show an action bar from "%MikaFamilierYamlValue({_p}, ""request.msg"", ""lang"")%" to {_p}
  330. wait 1 second
  331. else:
  332. show an action bar from "%MikaFamilierYamlValue({_p}, ""error.no-permission"", ""lang"")%" to {_p}
  333.  
  334. format gui slot 23 of {_p} with chestplate of {_entity} with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.chestplate.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.chestplate.lore"", ""lang"")%" to run function SettingsFamiliersNewArmor({_p}, "chestplate")
  335. format gui slot 32 of {_p} with leggings of {_entity} with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.legging.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.legging.lore"", ""lang"")%" to run function SettingsFamiliersNewArmor({_p}, "leggings")
  336. format gui slot 41 of {_p} with boots of {_entity} with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.settings.boot.name"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.settings.boot.lore"", ""lang"")%" to run function SettingsFamiliersNewArmor({_p}, "boots")
  337.  
  338. format gui slot 48 of {_p} with player head with custom nbt "{@Arrow Left}" named "%MikaFamilierYamlValue({_p}, ""gui.main.items.to-left.name"", ""lang"")%" to run function Familiers({_p}, "1")
  339.  
  340.  
  341. function SettingsFamiliers(p: player, s: text, v: text):
  342. if {_p} has permission "familier.config.%{_s}%" or "familier.config.*" or "familier.*":
  343. if {_v} is "true":
  344. set {Familiers::config::player::%{_p}%::%{_s}%} to true
  345. if {_v} is "false":
  346. delete {Familiers::config::player::%{_p}%::%{_s}%}
  347. FamiliersSettingsGui({_p})
  348. else:
  349. show an action bar from "%MikaFamilierYamlValue({_p}, ""error.no-permission"", ""lang"")%" to {_p}
  350.  
  351.  
  352. function SettingsFamiliersNewArmor(p: player, equipement: text):
  353. loop all entities in radius 3 of {_p}:
  354. if {Familiers::player::owner::%loop-entity%} is "%{_p}%":
  355. set {_entity} to loop-entity
  356. if {_p} has permission "familier.config.stuff" or "familier.config.*" or "familier.*":
  357. set {SettingsFamiliers.armorcolor.red.%{_p}%} to 0
  358. set {SettingsFamiliers.armorcolor.green.%{_p}%} to 0
  359. set {SettingsFamiliers.armorcolor.blue.%{_p}%} to 0
  360. open chest with 6 rows named "%MikaFamilierYamlValue({_p}, ""gui.color.Gui-name"", ""lang"")%" to {_p}
  361.  
  362. SettingsFamiliersNewColor({_p}, "%{_equipement}%")
  363. format gui slot 39 of {_p} with player head with custom nbt "{@Red}" named "%MikaFamilierYamlValue({_p}, ""gui.color.red"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.color.lore"", ""lang"")%" to run:
  364. if gui-click-type is right mouse button:
  365. remove 1 from {SettingsFamiliers.armorcolor.red.%{_p}%}
  366. if gui-click-type is left mouse button:
  367. add 1 to {SettingsFamiliers.armorcolor.red.%{_p}%}
  368. if gui-click-type is shift right:
  369. remove 10 from {SettingsFamiliers.armorcolor.red.%{_p}%}
  370. if gui-click-type is shift left:
  371. add 10 to {SettingsFamiliers.armorcolor.red.%{_p}%}
  372. if gui-click-type is drop key:
  373. set {SettingsFamiliers.armorcolor.red.%{_p}%} to 0
  374. SettingsFamiliersNewColor({_p}, "%{_equipement}%")
  375. format gui slot 40 of {_p} with player head with custom nbt "{@Green}" named "%MikaFamilierYamlValue({_p}, ""gui.color.green"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.color.lore"", ""lang"")%" to run:
  376. if gui-click-type is right mouse button:
  377. remove 1 from {SettingsFamiliers.armorcolor.green.%{_p}%}
  378. if gui-click-type is left mouse button:
  379. add 1 to {SettingsFamiliers.armorcolor.green.%{_p}%}
  380. if gui-click-type is shift right:
  381. remove 10 from {SettingsFamiliers.armorcolor.green.%{_p}%}
  382. if gui-click-type is shift left:
  383. add 10 to {SettingsFamiliers.armorcolor.green.%{_p}%}
  384. if gui-click-type is drop key:
  385. set {SettingsFamiliers.armorcolor.green.%{_p}%} to 0
  386. SettingsFamiliersNewColor({_p}, "%{_equipement}%")
  387. format gui slot 41 of {_p} with player head with custom nbt "{@Blue}" named "%MikaFamilierYamlValue({_p}, ""gui.color.blue"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.color.lore"", ""lang"")%" to run:
  388. if gui-click-type is right mouse button:
  389. remove 1 from {SettingsFamiliers.armorcolor.blue.%{_p}%}
  390. if gui-click-type is left mouse button:
  391. add 1 to {SettingsFamiliers.armorcolor.blue.%{_p}%}
  392. if gui-click-type is shift right:
  393. remove 10 from {SettingsFamiliers.armorcolor.blue.%{_p}%}
  394. if gui-click-type is shift left:
  395. add 10 to {SettingsFamiliers.armorcolor.blue.%{_p}%}
  396. if gui-click-type is drop key:
  397. set {SettingsFamiliers.armorcolor.blue.%{_p}%} to 0
  398. SettingsFamiliersNewColor({_p}, "%{_equipement}%")
  399. format gui slot 24 of {_p} with enchanted book named "%MikaFamilierYamlValue({_p}, ""gui.color.save"", ""lang"")%" with lore "%MikaFamilierYamlValue({_p}, ""gui.color.get"", ""lang"")%" to run:
  400. if {_equipement} is "chestplate":
  401. dye chestplate of {_entity} ({SettingsFamiliers.armorcolor.red.%{_p}%}, {SettingsFamiliers.armorcolor.green.%{_p}%}, {SettingsFamiliers.armorcolor.blue.%{_p}%})
  402. if {_equipement} is "leggings":
  403. dye leggings of {_entity} ({SettingsFamiliers.armorcolor.red.%{_p}%}, {SettingsFamiliers.armorcolor.green.%{_p}%}, {SettingsFamiliers.armorcolor.blue.%{_p}%})
  404. if {_equipement} is "boots":
  405. dye boots of {_entity} ({SettingsFamiliers.armorcolor.red.%{_p}%}, {SettingsFamiliers.armorcolor.green.%{_p}%}, {SettingsFamiliers.armorcolor.blue.%{_p}%})
  406. close {_p}'s inventory
  407. else:
  408. show an action bar from "%MikaFamilierYamlValue({_p}, ""error.no-permission"", ""lang"")%" to {_p}
  409. function SettingsFamiliersNewColor(p: player, equipement: text):
  410. if {_equipement} is "chestplate":
  411. format gui slot 22 of {_p} with leather chestplate with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.color.chestplate"", ""lang"")%" with lore " &c%{SettingsFamiliers.armorcolor.red.%{_p}%}%|| &a%{SettingsFamiliers.armorcolor.green.%{_p}%}%|| &b%{SettingsFamiliers.armorcolor.blue.%{_p}%}%"
  412. if {_equipement} is "leggings":
  413. format gui slot 22 of {_p} with leather leggings with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.color.legging"", ""lang"")%" with lore " &c%{SettingsFamiliers.armorcolor.red.%{_p}%}%|| &a%{SettingsFamiliers.armorcolor.green.%{_p}%}%|| &b%{SettingsFamiliers.armorcolor.blue.%{_p}%}%"
  414. if {_equipement} is "boots":
  415. format gui slot 22 of {_p} with leather boots with no nbt named "%MikaFamilierYamlValue({_p}, ""gui.color.boot"", ""lang"")%" with lore " &c%{SettingsFamiliers.armorcolor.red.%{_p}%}%|| &a%{SettingsFamiliers.armorcolor.green.%{_p}%}%|| &b%{SettingsFamiliers.armorcolor.blue.%{_p}%}%"
  416.  
  417. dye slot 22 of current inventory of {_p} ({SettingsFamiliers.armorcolor.red.%{_p}%}, {SettingsFamiliers.armorcolor.green.%{_p}%}, {SettingsFamiliers.armorcolor.blue.%{_p}%})
  418.  
  419.  
  420. # [ ✚ ] = PARTIE FAMILIERS GET ARMORSTAND | ➔ Functions
  421. #-------------------------------------------------------------------------------------------------------------------------------- |
  422.  
  423. function FamiliersSpawn(p: player, s: text, familier: text):
  424. loop all entities in radius 3 of {_p}:
  425. if {Familiers::player::owner::%loop-entity%} is "%{_p}%":
  426. set {_entity} to loop-entity
  427.  
  428. set {_id} to (yaml value "%{_s}%.id" from "familiers/data")
  429. set {_type} to (yaml value "%{_s}%.type" from "familiers/data")
  430. set {_perm} to (yaml value "%{_s}%.permission" from "familiers/data")
  431.  
  432. set {_skull} to (yaml value "%{_s}%.skull" from "familiers/data")
  433. set {_chestplate} to (yaml value "%{_s}%.chestplate" from "familiers/data")
  434. set {_legging} to (yaml value "%{_s}%.legging" from "familiers/data")
  435. set {_boot} to (yaml value "%{_s}%.boot" from "familiers/data")
  436.  
  437.  
  438.  
  439. if {_p} has permission "%{_perm}%" or "familier.spawn.*" or "familier.*":
  440. close {_p}'s inventory
  441. if {Familiers::player::Status::%{_p}%} is set:
  442. send "%MikaFamilierYamlValue({_p}, ""error.already-have-familier"", ""lang"")%" to {_p}
  443. else:
  444. set {Familiers::player::Status::%{_p}%} to "%{_familier}%"
  445. set {Familiers::player::Status-Type::%{_p}%} to "%{_type}%"
  446. kill {_entity}
  447. wait 2 ticks
  448. if (yaml value "options.FamilierPos2" from "familiers/config") is "up":
  449. set {_o} to location of {_p}'s head
  450. remove 0.5 from y coord of {_o}
  451. if (yaml value "options.FamilierPos2" from "familiers/config") is "down":
  452. set {_o} to location of {_p}
  453. set pitch of {_o} to 0
  454. if (yaml value "options.FamilierSize" from "familiers/config") is "right":
  455. if (yaml value "options.FamilierPos2" from "familiers/config") is "small":
  456. set {_o} to location .7 right of {_o}
  457. if (yaml value "options.FamilierSize" from "familiers/config") is "big":
  458. set {_o} to location 1.5 right of {_o}
  459. if (yaml value "options.FamilierPos" from "familiers/config") is "left":
  460. if (yaml value "options.FamilierSize" from "familiers/config") is "small":
  461. set {_o} to location .7 left of {_o}
  462. if (yaml value "options.FamilierSize" from "familiers/config") is "big":
  463. set {_o} to location 1.5 left of {_o}
  464.  
  465. spawn an armor stand at {_o}
  466. set {_entity} to spawned entity
  467. set {Familiers::player::owner::%{_entity}%} to "%{_p}%"
  468. set tool of {_entity} to tool of {_p}
  469. add "{NoGravity:1b,Invulnerable:1,NoBasePlate:1,DisabledSlots:2039583,ShowArms:1,Small:1,Pose:{LeftArm:[-10f,0f,-10f]},Pose:{RightArm:[-10f,0f,10f]}}" to nbt of {_entity}
  470. wait 1 ticks
  471. if (yaml value "options.FamilierNameSet" from "familiers/config") is true:
  472. set {_n} to (yaml value "options.FamilierName" from "familiers/config")
  473. replace all "[PLAYER]" in {_n} with "%{_p}%"
  474. add "{CustomNameVisible:1,CustomName:%colored {_n}%}" to nbt of {_entity}
  475. wait 1 ticks
  476. if (yaml value "options.FamilierSize" from "familiers/config") is "big":
  477. add "{Small:0}" to nbt of {_entity}
  478.  
  479. if {_type} is "armor":
  480. if {_id} is set:
  481. set armor stand helmet of {_entity} to player head with custom nbt "%{_skull}%"
  482. set armor stand chestplate of {_entity} to leather chestplate with custom nbt "{display:{color:%{_chestplate}%}}"
  483. set armor stand leggings of {_entity} to leather leggings with custom nbt "{display:{color:%{_legging}%}}"
  484. set armor stand boots of {_entity} to leather boots with custom nbt "{display:{color:%{_boot}%}}"
  485. if {_id} is "fantome":
  486. add "{Invisible:1}" to nbt of {_entity}
  487. set armor stand leggings of {_entity} to air
  488. set armor stand boots of {_entity} to air
  489. if {_type} is "only-head":
  490. set tool of {_entity} to air
  491. set armor stand helmet of {_entity} to player head with custom nbt "%{_skull}%"
  492. set armor stand chestplate of {_entity} to air
  493. set armor stand leggings of {_entity} to air
  494. set armor stand boots of {_entity} to air
  495. add "{Invisible:1}" to nbt of {_entity}
  496.  
  497. if {_familier} is "player":
  498. if {_p}'s chestplate is air:
  499. set armor stand chestplate of {_entity} to diamond chestplate
  500. else:
  501. set armor stand chestplate of {_entity} to chestplate of {_p}
  502.  
  503. if {_p}'s leggings is air:
  504. set armor stand leggings of {_entity} to leather leggings with custom nbt "{display:{color:%{_legging}%}}"
  505. else:
  506. set armor stand leggings of {_entity} to leggings of {_p}
  507. if {_p}'s boots is air:
  508. set armor stand boots of {_entity} to leather boots with custom nbt "{display:{color:%{_boot}%}}"
  509. else:
  510. set armor stand boots of {_entity} to boots of {_p}
  511. set armor stand helmet of {_entity} to skull of {_p}
  512. RunfamilierAnimations({_p}, "%{_familier}%", "bras")
  513. RunfamilierAnimations({_p}, "%{_familier}%", "other")
  514.  
  515. while {Familiers::player::Status::%{_p}%} is set:
  516. if (yaml value "options.FamilierOptions" from "familiers/config") is "global":
  517. if (yaml value "options.FamilierAnimationVue" from "familiers/config") is true:
  518. if {Familiers::player::Status-Type::%{_p}%} is "armor":
  519. add "{Pose:{Head:[%{_p}'s pitch%f,0f,0f]}}" to nbt of {_entity}
  520. else:
  521. if {Familiers::config::player::%{_p}%::vue} is true:
  522. if {Familiers::player::Status-Type::%{_p}%} is "armor":
  523. add "{Pose:{Head:[%{_p}'s pitch%f,0f,0f]}}" to nbt of {_entity}
  524. if (yaml value "options.FamilierPos2" from "familiers/config") is "up":
  525. set {_o} to location of {_p}'s head
  526. remove 0.5 from y coord of {_o}
  527. if (yaml value "options.FamilierPos2" from "familiers/config") is "down":
  528. set {_o} to location of {_p}
  529. set pitch of {_o} to 0
  530. if (yaml value "options.FamilierPos" from "familiers/config") is "right":
  531. if (yaml value "options.FamilierSize" from "familiers/config") is "small":
  532. set {_o} to location .7 right of {_o}
  533. if (yaml value "options.FamilierSize" from "familiers/config") is "big":
  534. set {_o} to location 1.5 right of {_o}
  535. if (yaml value "options.FamilierPos" from "familiers/config") is "left":
  536. if (yaml value "options.FamilierSize" from "familiers/config") is "small":
  537. set {_o} to location .7 left of {_o}
  538. if (yaml value "options.FamilierSize" from "familiers/config") is "big":
  539. set {_o} to location 1.5 left of {_o}
  540. if (yaml value "options.FamilierOptions" from "familiers/config") is "global":
  541. if (yaml value "options.FamilierAnimationSneak" from "familiers/config") is true:
  542. if {_p} is sneaking:
  543. add "{Pose:{Body:[20f,0f,0f]}}" to nbt of {_entity}
  544. else:
  545. add "{Pose:{Body:[0f,0f,0f]}}" to nbt of {_entity}
  546. else:
  547. if {Familiers::config::player::%{_p}%::sneak} is true:
  548. if {_p} is sneaking:
  549. add "{Pose:{Body:[20f,0f,0f]}}" to nbt of {_entity}
  550. else:
  551. add "{Pose:{Body:[0f,0f,0f]}}" to nbt of {_entity}
  552. if {Familiers::player::PvP::Status::%{_p}%} is not set:
  553. teleport {_entity} to {_o}
  554. if {Familiers::player::PvP::Status::%{_p}%} is set:
  555. teleport {_entity} 2000 up {_o}
  556. wait 1 ticks
  557. else:
  558. show an action bar from "%MikaFamilierYamlValue({_p}, ""error.no-permission"", ""lang"")%" to {_p}
  559.  
  560. # [ ✚ ] = PARTIE FAMILIERS ANIMATIONS | ➔ Functions
  561. #-------------------------------------------------------------------------------------------------------------------------------- |
  562.  
  563. function RunfamilierAnimations(p: player, anim: text, argument: text):
  564. loop all entities in radius 3 of {_p}:
  565. if {Familiers::player::owner::%loop-entity%} is "%{_p}%":
  566. set {_entity} to loop-entity
  567. if {_argument} is "bras":
  568. if (yaml value "options.FamilierOptions" from "familiers/config") is "global":
  569. if (yaml value "options.FamilierAnimationBras" from "familiers/config") is true:
  570. wait 1.5 seconds
  571. while {Familiers::player::Status::%{_p}%} is set:
  572. set {_leftA} to -10
  573. set {_leftB} to 10
  574. loop 10 times:
  575. if {Familiers::player::Status::%{_p}%} is set:
  576. add "{Pose:{LeftArm:[-10f,0f,%{_leftA}%f]}}" to nbt of {_entity}
  577. add "{Pose:{RightArm:[-10f,0f,%{_leftB}%f]}}" to nbt of {_entity}
  578. remove 1 from {_leftA}
  579. add 1 to {_leftB}
  580. wait 1.8 ticks
  581. else:
  582. stop
  583. loop 10 times:
  584. if {Familiers::player::Status::%{_p}%} is set:
  585. add "{Pose:{LeftArm:[-10f,0f,%{_leftA}%f]}}" to nbt of {_entity}
  586. add "{Pose:{RightArm:[-10f,0f,%{_leftB}%f]}}" to nbt of {_entity}
  587. add 1 to {_leftA}
  588. remove 1 from {_leftB}
  589. else:
  590. stop
  591. wait 1.8 ticks
  592. wait 1 seconds
  593. else:
  594. if {Familiers::config::player::%{_p}%::bras} is true:
  595. wait 1.5 seconds
  596. while {Familiers::player::Status::%{_p}%} is set:
  597. set {_leftA} to -10
  598. set {_leftB} to 10
  599. loop 10 times:
  600. if {Familiers::player::Status::%{_p}%} is set:
  601. add "{Pose:{LeftArm:[-10f,0f,%{_leftA}%f]}}" to nbt of {_entity}
  602. add "{Pose:{RightArm:[-10f,0f,%{_leftB}%f]}}" to nbt of {_entity}
  603. remove 1 from {_leftA}
  604. add 1 to {_leftB}
  605. wait 1.8 ticks
  606. else:
  607. stop
  608. loop 10 times:
  609. if {Familiers::player::Status::%{_p}%} is set:
  610. add "{Pose:{LeftArm:[-10f,0f,%{_leftA}%f]}}" to nbt of {_entity}
  611. add "{Pose:{RightArm:[-10f,0f,%{_leftB}%f]}}" to nbt of {_entity}
  612. add 1 to {_leftA}
  613. remove 1 from {_leftB}
  614. else:
  615. stop
  616. wait 1.8 ticks
  617. wait 1 seconds
  618.  
  619. if {_argument} is "other":
  620.  
  621. if {_anim} is "evil":
  622. set {_a} to {_anim}
  623. while {Familiers::player::Status::%{_p}%} is "%{_a}%":
  624. set {familier::animation::use::%{_p}%} to true
  625. wait 1 seconds
  626. ignite {_entity}
  627. wait 5 seconds
  628. extinguish {_entity}
  629. delete {familier::animation::use::%{_p}%}
  630. wait 5 seconds
  631.  
  632. # Coller le code de l'animation ici en respectant l'indentation ! (pour ajouter une autre animation, faites pareil en sautant une ligne !)
  633.  
  634.  
  635. # [ ✚ ] = PARTIE FAMILIERS| ➔ Système
  636. #-------------------------------------------------------------------------------------------------------------------------------- |
  637. On chat:
  638. loop all entities in radius 3 of player:
  639. if {Familiers::player::owner::%loop-entity%} is "%player%":
  640. set {_entity} to loop-entity
  641. if {lockchat.familier.%player%} is set:
  642. cancel event
  643. set message format to "%message%"
  644. set {_fam-msg} to message format
  645.  
  646.  
  647. if message is "Stop" or "Cancel":
  648. send "%MikaFamilierYamlValue(player, ""request.stop"", ""lang"")%" to player
  649.  
  650. if {lockchat.familier.%player%} is "head":
  651. send "%MikaFamilierYamlValue(player, ""request.get-skull"", ""lang"")%" to player
  652. set armor stand helmet of {_entity} to (skull of "%{_fam-msg}%" parsed as offline player)
  653.  
  654. if {lockchat.familier.%player%} is "rename":
  655. if length of {_fam-msg} <= (yaml value "options.FamilierNameMaxLength" from "familiers/config"):
  656. add "{CustomNameVisible:1,CustomName:%colored {_fam-msg}%}" to nbt of {_entity}
  657. show an action bar from "%MikaFamilierYamlValue(player, ""request.get-rename"", ""lang"")%" to player
  658. else:
  659. send "%MikaFamilierYamlValue(player, ""error.length-error"", ""lang"")%" to player
  660.  
  661. delete {lockchat.familier.%player%}
  662. stop
  663.  
  664. on jump:
  665. loop all entities in radius 3 of player:
  666. if {Familiers::player::owner::%loop-entity%} is "%player%":
  667. set {_entity} to loop-entity
  668. if (yaml value "options.FamilierOptions" from "familiers/config") is "global":
  669. if (yaml value "options.FamilierAnimationJump" from "familiers/config") is true:
  670. if {Familiers::player::Status::%player%} is set:
  671. if {Familiers::player::Status-Type::%player%} is "armor":
  672. set {_count} to 0
  673. set {_count2} to 0
  674. loop 5 times:
  675. add "{Pose:{LeftLeg:[0f,0f,-%{_count}%f]}}" to nbt of {_entity}
  676. add "{Pose:{RightLeg:[0f,0f,%{_count}%f]}}" to nbt of {_entity}
  677. add "{Pose:{LeftArm:[0f,0f,-%{_count2}%f]}}" to nbt of {_entity}
  678. add "{Pose:{RightArm:[0f,0f,%{_count2}%f]}}" to nbt of {_entity}
  679. add 9 to {_count}
  680. add 36 to {_count2}
  681. wait 1.2 ticks
  682. loop 6 times:
  683. add "{Pose:{LeftLeg:[0f,0f,-%{_count}%f]}}" to nbt of {_entity}
  684. add "{Pose:{RightLeg:[0f,0f,%{_count}%f]}}" to nbt of {_entity}
  685. add "{Pose:{LeftArm:[0f,0f,-%{_count2}%f]}}" to nbt of {_entity}
  686. add "{Pose:{RightArm:[0f,0f,%{_count2}%f]}}" to nbt of {_entity}
  687. remove 9 from {_count}
  688. remove 36 from {_count2}
  689. wait 1.2 ticks
  690. else:
  691. if {Familiers::config::player::%player%::jump} is true:
  692. if {Familiers::player::Status::%player%} is set:
  693. if {Familiers::player::Status-Type::%player%} is "armor":
  694. set {_count} to 0
  695. set {_count2} to 0
  696. loop 5 times:
  697. add "{Pose:{LeftLeg:[0f,0f,-%{_count}%f]}}" to nbt of {_entity}
  698. add "{Pose:{RightLeg:[0f,0f,%{_count}%f]}}" to nbt of {_entity}
  699. add "{Pose:{LeftArm:[0f,0f,-%{_count2}%f]}}" to nbt of {_entity}
  700. add "{Pose:{RightArm:[0f,0f,%{_count2}%f]}}" to nbt of {_entity}
  701. add 9 to {_count}
  702. add 36 to {_count2}
  703. wait 1.2 ticks
  704. loop 6 times:
  705. add "{Pose:{LeftLeg:[0f,0f,-%{_count}%f]}}" to nbt of {_entity}
  706. add "{Pose:{RightLeg:[0f,0f,%{_count}%f]}}" to nbt of {_entity}
  707. add "{Pose:{LeftArm:[0f,0f,-%{_count2}%f]}}" to nbt of {_entity}
  708. add "{Pose:{RightArm:[0f,0f,%{_count2}%f]}}" to nbt of {_entity}
  709. remove 9 from {_count}
  710. remove 36 from {_count2}
  711. wait 1.2 ticks
  712.  
  713. on left click:
  714. loop all entities in radius 3 of player:
  715. if {Familiers::player::owner::%loop-entity%} is "%player%":
  716. set {_entity} to loop-entity
  717. if (yaml value "options.FamilierOptions" from "familiers/config") is "global":
  718. if (yaml value "options.FamilierAnimationAttack" from "familiers/config") is true:
  719. if {Familiers::player::Status::%player%} is set:
  720. if {Familiers::player::Status-Type::%player%} is "armor":
  721. set {_count} to 10
  722. loop 5 times:
  723. add "{Pose:{RightArm:[-%{_count}%f]}}" to nbt of {_entity}
  724. add 18 to {_count}
  725. wait 0.5 ticks
  726. set {_count} to 10
  727. loop 5 times:
  728. add "{Pose:{RightArm:[%{_count}%f]}}" to nbt of {_entity}
  729. add 18 to {_count}
  730. wait 0.5 ticks
  731. add "{Pose:{RightArm:[0f,0f,10f]}}" to nbt of {_entity}
  732. else:
  733. if {Familiers::config::player::%player%::attack} is true:
  734. if {Familiers::player::Status::%player%} is set:
  735. if {Familiers::player::Status-Type::%player%} is "armor":
  736. set {_count} to 10
  737. loop 5 times:
  738. add "{Pose:{RightArm:[-%{_count}%f]}}" to nbt of {_entity}
  739. add 18 to {_count}
  740. wait 0.5 ticks
  741. set {_count} to 10
  742. loop 5 times:
  743. add "{Pose:{RightArm:[%{_count}%f]}}" to nbt of {_entity}
  744. add 18 to {_count}
  745. wait 0.5 ticks
  746. add "{Pose:{RightArm:[0f,0f,10f]}}" to nbt of {_entity}
  747.  
  748. on damage of player:
  749. if {Familiers::player::owner::%victim%} is set:
  750. cancel event
  751. attacker is player
  752. if {Familiers::player::Status::%attacker%} is set:
  753. if {Familiers::player::PvP::Status::%attacker%} is not set:
  754. send "%MikaFamilierYamlValue(attacker, ""pvp.in-combat"", ""lang"")%" to attacker
  755. send "%MikaFamilierYamlValue(victim, ""pvp.in-combat"", ""lang"")%" to victim
  756.  
  757. set {Familiers::player::PvP::Status::%attacker%} to true
  758. set {Familiers::player::PvP::Status::%attacker%.lastused} to now
  759.  
  760. if {Familiers::player::Status::%victim%} is set:
  761. set {Familiers::player::PvP::Status::%victim%} to true
  762.  
  763. if {Familiers::player::Status::%attacker%} is not set:
  764. set {Familiers::player::PvP::Status::%attacker%} to true
  765. set {Familiers::player::PvP::Status::%attacker%.lastused} to now
  766.  
  767. if {Familiers::player::Status::%victim%} is not set:
  768. set {Familiers::player::PvP::Status::%victim%} to true
  769.  
  770. # set {_x} to (yaml value "options.FamilierPVPCooldown" from "familiers/config")
  771. wait 5 seconds
  772. if {Familiers::player::PvP::Status::%attacker%.lastused} was more than 99 ticks ago:
  773. if {Familiers::player::Status::%attacker%} is set:
  774. send "%MikaFamilierYamlValue(attacker, ""pvp.out-combat"", ""lang"")%" to attacker
  775. if {Familiers::player::Status::%victim%} is set:
  776. send "%MikaFamilierYamlValue(victim, ""pvp.out-combat"", ""lang"")%" to victim
  777. delete {Familiers::player::PvP::Status::%attacker%}
  778. delete {Familiers::player::PvP::Status::%victim%}
  779. delete {Familiers::player::PvP::Status::%attacker%.lastused}
  780.  
  781. on command:
  782. if {Familiers::player::PvP::Status::%player%} is set:
  783. if command is "familier" or "familiers":
  784. cancel event
  785. send "%MikaFamilierYamlValue(player, ""pvp.cmd-error"", ""lang"")%" to player
  786.  
  787. on tool change:
  788. loop all entities in radius 3 of player:
  789. if {Familiers::player::owner::%loop-entity%} is "%player%":
  790. set {_entity} to loop-entity
  791. if (yaml value "options.FamilierOptions" from "familiers/config") is "global":
  792. if (yaml value "options.FamilierToolChange" from "familiers/config") is true:
  793. if {Familiers::player::Status::%player%} is set:
  794. if {Familiers::player::Status-Type::%player%} is "armor":
  795. set tool of {_entity} to tool of player
  796. else:
  797. set tool of {_entity} to air
  798. else:
  799. if {Familiers::config::player::%player%::tool-change} is true:
  800. if {Familiers::player::Status::%player%} is set:
  801. if {Familiers::player::Status-Type::%player%} is "armor":
  802. set tool of {_entity} to tool of player
  803. else:
  804. set tool of {_entity} to air
  805.  
  806. on pickup:
  807. if name of event-item contains "&cfamilier-drop.":
  808. cancel event
  809.  
  810. on quit:
  811. loop all entities in radius 3 of player:
  812. if {Familiers::player::owner::%loop-entity%} is "%player%":
  813. set {_entity} to loop-entity
  814. delete {Familiers::player::%player%}
  815. kill {_entity}
  816. delete {_entity}
  817.  
  818. on teleport:
  819. loop all entities in radius 3 of player:
  820. if {Familiers::player::owner::%loop-entity%} is "%player%":
  821. set {_entity} to loop-entity
  822. if (yaml value "options.FamilierRemoveOnTeleport" from "familiers/config") is true:
  823. if {Familiers::player::Status::%player%} is set:
  824. delete {Familiers::player::%player%}
  825. kill {_entity}
  826. delete {_entity}
  827. else:
  828. teleport {_entity} to player
  829.  
  830. on damage:
  831. if {Familiers::player::owner::%victim%} is set:
  832. cancel event
  833.  
  834. on script stop:
  835. loop all armor stands:
  836. if {Familiers::player::owner::%loop-entity%} is set:
  837. kill loop-entity
  838. delete loop-entity
  839. loop all players:
  840. delete {Familiers::player::Status::%loop-player%}
  841.  
  842. #⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊|
  843. # |
  844. # FIN DU CODE | ➔ Le code est fini ! Merci d'avoir télécharger mon Skript ! Version : 1.7
  845. # |
  846. #⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊⚊|
  847. #-------------------------------------------------------------------------------------------------------------------------------- |
Add Comment
Please, Sign In to add comment