# Command to be run in-game to teleport a group of players in one place to another teleport_command: type: command name: groupTP aliases: - gtp - groupteleport - teleportgroup permission: groupteleport.teleport description: Teleports a group of players within a predefined area to another predefined area usage: /groupTP (posA) (posB) tab completions: # Lists all valid cuboid locations 1: 2: script: - define util_cuboid_list # Checks command provided had correct amount of arguements to be valid - if == 2: # Defines the cuboids and catches if they are incorrectly named - define notableA ].if_null[null]> - define notableB ].if_null[null]> # If notableB was a location - define notableBlocation ].if_null[null]> # If first location is invalid - if <[notableA]> == null: # If both locations are invalid - if <[notableB]> == null: - narrate "Neither location exist!" # If only first location is invalid - else: - narrate "Your first location doesn't exist!" # If first location is valid - else: - if <[notableB]> == null: - if <[notableBlocation]> == null: # If second location is invalid - narrate "Your second location doesn't exist!" - else: - teleport <[notableA].players> <[notableBlocation].as[Location]> - narrate 'Players teleported to location' # If both locations are valid and the command is properly syntaxed - else: - teleport <[notableA].players> <[notableB].center> - narrate 'Players teleported to cuboid' # Teleports all players within arg1 to arg2 cuboids centre # Provided too many or too few arguements - else: - narrate 'Incorrect amount of arguements!' gui_cuboid: type: item material: black_wool lore: - <&3> Cuboid group_server_tp_gui: type: inventory inventory: chest size: 27 gui: true procedural items: - define num_cuboids - repeat <[num_cuboids]> as:n: - define cuboid - define num_cuboids_list:->:<[cuboid].with_flag[cuboid:<[n]>]> - determine <[num_cuboids_list]> group_server_tp_clicked: type: world events: on player clicks item_flagged:cuboid in group_server_tp_gui: - define cuboidItem - define notableA cuboid<[cuboidItem]> - narrate <[notableA]>