Advertisement
Builder4Life

portal skript | would appreciate some feedback

Mar 15th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. options:
  2. prefix: <##408cde>&lᴘᴏʀᴛᴀʟ
  3. chatc: <##c8d9eb>
  4. chatc2: <##82b3e8>
  5.  
  6. portalwand: stick named "<##800be0>&lᴘᴏʀᴛᴀʟᴡᴀɴᴅ" with lore "", "&7Left click to set &fPos1", "&7Right click to set &fPos2" with all flags hidden
  7.  
  8. on left click with stick:
  9. if 1 of player's tool is {@portalwand}:
  10. set {position.1.%uuid of player%} to location of clicked block
  11. send "{@prefix} &8» {@chatc2}Pos1 {@chatc}has been set"
  12.  
  13. on right click with stick:
  14. if 1 of player's tool is {@portalwand}:
  15. set {position.2.%uuid of player%} to location of clicked block
  16. send "{@prefix} &8» {@chatc2}Pos2 {@chatc}has been set"
  17.  
  18. on block break:
  19. if 1 of player's tool is {@portalwand}:
  20. cancel event
  21.  
  22. on disconnect:
  23. delete {position.1.%uuid of player%}
  24. delete {position.2.%uuid of player%}
  25.  
  26. on bound enter:
  27. set {_id} to id of event-bound
  28. if {portal.list::*} contains {_id}:
  29. if {portal.loc.%{_id}%} is set:
  30. teleport player to {portal.loc.%{_id}%}
  31. send "{@prefix} &8» {@chatc}you have been teleported to {@chatc2}%{_id}%"
  32. else:
  33. send "{@prefix} &8» {@chatc}First set the location u want to teleport to"
  34. else:
  35. send "testing %{_id}%"
  36.  
  37.  
  38. command /portalwand:
  39. permission: portal.wand
  40. trigger:
  41. give player {@portalwand}
  42. send "{@prefix} &8» {@chatc}You succesfully recieved 1x {@chatc2}ᴘᴏʀᴛᴀʟᴡᴀɴᴅ"
  43.  
  44. command /createportal [<text>]:
  45. permission: portal.create
  46. trigger:
  47. if arg-1 is set:
  48. if {portal.list::*} contains arg-1:
  49. send "{@prefix} &8» {@chatc}This portal already exists"
  50. else:
  51. if {position.1.%uuid of player%} is set:
  52. if {position.2.%uuid of player%} is set:
  53. add arg-1 to {portal.list::*}
  54. create a new bound with id arg-1 between {position.1.%uuid of player%} and {position.2.%uuid of player%}
  55. send "{@prefix} &8» {@chatc}Succesfully created a portal named {@chatc2}%arg-1%"
  56. else:
  57. send "{@prefix} &8» {@chatc}Your {@chatc2}Pos2 {@chatc}is not set"
  58. else:
  59. send "{@prefix} &8» {@chatc}Your {@chatc2}Pos2 {@chatc}is not set"
  60. else:
  61. send "{@prefix} &8» {@chatc}Specify the name u want to create a portal with"
  62.  
  63. command /delportal [<text>]:
  64. permission: portal.delete
  65. trigger:
  66. if arg-1 is set:
  67. if {portal.list::*} contains arg-1:
  68. delete bound with id arg-1
  69. remove arg-1 from {portal.list::*}
  70. delete {portal.loc.%arg-1%}
  71. send "{@prefix} &8» {@chatc}succesfully deleted a portal named {@chatc2}%arg-1%"
  72. else:
  73. send "{@prefix} &8» {@chatc}This portal does not exist"
  74. else:
  75. send "{@prefix} &8» {@chatc}Specify the name of the portal you want to delete"
  76.  
  77. on tab complete of "/delportal":
  78. set tab completions for position 1 to {portal.list::*}
  79.  
  80. command /portal [<text>] [<text>]:
  81. permission: portal.mcmd
  82. trigger:
  83. if arg-1 is "setloc":
  84. if arg-2 is set:
  85. if {portal.list::*} contains arg-2:
  86. set {portal.loc.%arg-2%} to player's position
  87. set yaw of {portal.loc.%arg-2%} to player's yaw
  88. set pitch of {portal.loc.%arg-2%} to player's pitch
  89. send "{@prefix} &8» {@chatc}The location for {@chatc2}%arg-2% {@chatc}has been set"
  90. else:
  91. send "{@prefix} &8» {@chatc}A portal named {@chatc2}%arg-2% {@chatc}does not exist"
  92. else:
  93. send "{@prefix} &8» {@chatc}Specify the portal u want to set a location for"
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement