Created a simple way to keep track of variables,
functions and commands Added a basic start of game modified: plugins/scripts/scripts/skybattle.skmain
parent
58829f1461
commit
4f7a9cf992
|
@ -0,0 +1,72 @@
|
|||
# border, spawny pro 3 různé lokace map, inventář
|
||||
# skybattle::gaming_players::* - players in IDList1-10 [list of all players]
|
||||
# skybattle::game_status - identifies game status [init, next, playing, end]
|
||||
# skybattle::game_on - identifies if the game is playing [True, False]
|
||||
# skybattle::intro - identifies if intro is playing rn [True, False]
|
||||
# skybattle::stop_players - triggers a function that stops players from moving [True, False]
|
||||
# skybattle::borders::border[1-3] - stores center of borders 1-3 [coords]
|
||||
# skybattle::deadplayers::* - stores all dead players in current round [list of players]
|
||||
# skybattle::current_arena - stores current round/arena [1-3]
|
||||
# skybattle::introlocation - stores intro location [coords] ! must have barrier to stand on !
|
||||
# skybattle::spectatorlocation[1-3] - stores location for spectators to spawn on [coords]
|
||||
|
||||
command /minigame_skybattle_start:
|
||||
description: Zapni celou minihru skybattle
|
||||
usage: /minigame_skybattle_start
|
||||
executable by: the console and players
|
||||
permission: skript.op
|
||||
trigger:
|
||||
execute console command "/gamerule keepInventory true"
|
||||
clear {skybattle::gaming_players::*}
|
||||
loop 10 times:
|
||||
loop entries of team "IDList%loop-number%":
|
||||
add loop-value2 to {skybattle::gaming_players::*}
|
||||
broadcast "Načítám minihru Sky Battle"
|
||||
send title "§2Sky Battle" to all players
|
||||
set {skybattle::game_status} to "init"
|
||||
set {skybattle::game_on} to "True"
|
||||
wait 2 seconds
|
||||
send subtitle "Teleportuji" to all players
|
||||
wait 1 second
|
||||
set {skybattle::intro} to "True"
|
||||
set gamemode of {skybattle::gaming_players::*} to adventure
|
||||
teleport {skybattle::gaming_players::*} to {skybattle::introlocation}
|
||||
set {skybattle::stop_players} to "True"
|
||||
|
||||
command /skybattle_setborder <number>:
|
||||
description: Set center of border for map x
|
||||
usage: /skybattle_setborder <id of border/arena>
|
||||
permission: skript.op
|
||||
trigger:
|
||||
if arg-1 is 1:
|
||||
set {skybattle::borders::border1} to player's location
|
||||
send "Border 1 set to your location" to player
|
||||
else if arg-1 is 2:
|
||||
set {skybattle::borders::border2} to player's location
|
||||
send "Border 2 set to your location" to player
|
||||
else if arg-1 is 3:
|
||||
set {skybattle::borders::border3} to player's location
|
||||
send "Border 3 set to your location" to player
|
||||
else:
|
||||
send "The only valid options for id of border are 1, 2, 3" to player
|
||||
|
||||
on death of player:
|
||||
add victim's uuid to {skybattle::deadplayers::*}
|
||||
launch ball large coloured yellow fading to light green and black at victim's location with duration 0
|
||||
|
||||
on respawn:
|
||||
if {skybattle::deadplayers::*} contains player's uuid:
|
||||
clear player's inventory
|
||||
set player's gamemode to spectator
|
||||
teleport player to {skybattle::spectatorlocation%{skybattle::current_arena}%}
|
||||
wait 20 ticks
|
||||
set player's gamemode to adventure
|
||||
set player's gamemode to spectator
|
||||
|
||||
on player move:
|
||||
if {skybattle::stop_players} is "True":
|
||||
if {skybattle::gaming_players::*} contains player:
|
||||
cancel event
|
||||
|
||||
on food bar change:
|
||||
cancel event
|
Loading…
Reference in New Issue