Date: 2023/11/01 15:24:31 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# 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: <util.notes[cuboids].replace_text[cu@]>
2: <util.notes[cuboids].replace_text[cu@]><util.notes[locations].replace_text[li@l@]>
script:
- define util_cuboid_list <util.notes[cuboids]>
# Checks command provided had correct amount of arguements to be valid
- if <context.args.size> == 2:
# Defines the cuboids and catches if they are incorrectly named
- define notableA <cuboid[<context.args.get[1]>].if_null[null]>
- define notableB <cuboid[<context.args.get[2]>].if_null[null]>
# If notableB was a location
- define notableBlocation <location[<context.args.get[2]>].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 <util.notes[cuboids].size>
- repeat <[num_cuboids]> as:n:
- define cuboid <item[gui_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 <context.item>
- define notableA cuboid<[cuboidItem]>
- narrate <[notableA]>