Date: 2020/03/22 22:51:10 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
brjoin:
##WAS BRSTART
debug: true
type: command
name: bridgejoin
description: brjoin
usage: /bridgestart
permission: bridge.command.join
aliases:
- brjoin
script:
##SHOULD I MAKE A FLAG MAP FOR PLAYING STATE, TEAM COLOR, ETC. RATHER THAN DIFFERENT FLAGS?
- if <player.flag[playingbridge]||null> == null:
- if <server.flag[BridgeArenas]||null> != null:
- if !<context.args.is_empty>:
- if <server.flag[BridgeArenas].contains[<context.raw_args>]>:
- flag player playingbridge:waiting
- flag player bridgearena:<context.raw_args.to_titlecase>
- else:
- narrate "<&c>No arena exists by that name!"
- else:
- flag player playingbridge:waiting
- flag player bridgearena:<server.flag[BridgeArenas].random[1].separated_by[<empty>].to_titlecase>
##SHOULD I ADD THE SIDEBAR, OR JUST FLAG IT FOR THE ON TICK EVENT TO CATCH? FOR NOW, DON'T BECAUSE LESS LINES
- sidebar set "title:<&6><&l>BREAD<&d><&l>BRIDGE" "values:<&b>|<&f>Players: <&a><player.world.players.filter[has_flag[playingbridge]].size>/2|<&f>Map: <&b><player.flag[bridgearena]>||<&f>Waiting for players...|<&f>|<&e>mc.breadpixel.net" players:<player.world.players.filter[has_flag[playingbridge]]>
- narrate "<&e>Joined BreadBridge arena <&a><player.flag[bridgearena]><&e>!"
#- sidebar set "title:<&6><&l>BREAD<&d><&l>BRIDGE" "values:<&b>|<&f>Players: <&a><player.world.players.filter[has_flag[playingbridge]].size>/2|<&f>Map: <&b>Test||<&f>Waiting for players...|<&f>|<&e>mc.breadpixel.net"
- if <player.world.players.filter[has_flag[playingbridge]].filter[flag[playingbridge].is[==].to[waiting]].size> == 1:
- if <util.random.int[1].to[100]> <= 50:
- flag player bridgeteamcolor:yellow
- teleport <player> <server.flag[bridge.arenas.<player.flag[bridgearena]>.respawn1]>
- else:
- flag player bridgeteamcolor:pink
- teleport <player> <server.flag[bridge.arenas.<player.flag[bridgearena]>.respawn2]>
- else if <player.world.players.filter[has_flag[playingbridge]].filter[flag[playingbridge].is[==].to[waiting]].size> == 2:
- if <player.world.players.filter[has_flag[bridgeteamcolor]].filter[flag[bridgeteamcolor].is[==].to[yellow]].size> == 1:
- flag player bridgeteamcolor:pink
- teleport <player> <server.flag[bridge.arenas.<player.flag[bridgearena]>.respawn2]>
- else if <player.world.players.filter[has_flag[bridgeteamcolor]].filter[flag[bridgeteamcolor].is[==].to[pink]].size> == 1:
- flag player bridgeteamcolor:yellow
- teleport <player> <server.flag[bridge.arenas.<player.flag[bridgearena]>.respawn1]>
- schematic load name:bridge.arenas.<player.flag[bridgearena]>.cage1
- inject bridgestartgame
- else:
- narrate "<&c>No arenas have been created!"
- else:
- narrate "<&c>You're already in a match!"