noftaly

warp gui simplifie

Sep 12th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. options:
  2. logo: &4[&cWarp&4]
  3.  
  4. command /setwarp [<text>]:
  5. permission: warp.edit
  6. permission message: &cTu ne peux pas faire cela !
  7. trigger:
  8. if arg-1 is set:
  9. if {warps::list::*} contains arg-1: # Si le warp existe déjà
  10. message "{@logo} &cImpossible : ce warp existe déjà"
  11. else:
  12. if arg-1 parsed as integer is an integer:
  13. message "{@logo} &cImpossible : tu ne peux pas mettre juste un nombre." # Oui, sinon y'a un bug avec les listes...
  14. stop
  15. add arg-1 to {warps::list::*} # Nom du warp
  16. set {warps::list::%arg-1%::loc} to player's position # Position du warp
  17. set {warps::list::%arg-1%::item} to ender pearl # Item de base dans le GUI
  18. message "{@logo} &aWarp %arg-1% créé !"
  19. else:
  20. message "&cUsage : /setwarp <nom>"
  21.  
  22. command /warp [<text>]:
  23. aliases: warps
  24. trigger:
  25. # Si le warp existe :
  26. if {warps::list::*} contains arg-1:
  27. teleport player to {warps::list::%arg-1%::loc}
  28. message "{@logo} &eTu as été téléporté !"
  29.  
  30. # Sinon :
  31. else:
  32.  
  33. # Ouverture du GUI
  34. open virtual chest inventory with 6 rows named "&cListe des warps" to player # On ouvre le GUI
  35. format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 and 35 of player with black stained glass pane
  36.  
  37. # Affichage des warps dans le GUI :
  38. if (size of {warps::list::*}) > 0: # S'il y au moins 1 warp
  39. set {_i} to 0
  40. loop {warps::list::*}:
  41. set {_lore} to "||&eClique gauche : se téléporter"
  42. set {_lv} to loop-value
  43. format gui slot {_i} of player with {warps::list::%{_lv}%::item} named {_lv} with lore {_lore} to run:
  44. make player execute command "/warp %{_lv}%" # On le TP au warp
  45. add 1 to {_i}
Advertisement
Add Comment
Please, Sign In to add comment