Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- spawn: 706.5, 31.5, -7.5
- world: CTF2
- maps: 2
- gamenumber: 1
- on load:
- delete {gamecoords::*}
- #MAP COORDS
- #!map 1 - flower map
- #blue
- set {gamecoords::bflag1} to location at 95, 58.5, 711.5 of "{@world}"
- set {gamecoords::bset1} to "/setblock 95 58 711 minecraft:wall_banner 9 false {Base:4}"
- set {gamecoords::bspawn1} to location at 65.5, 61.5, 704.5 of "{@world}"
- #red
- set {gamecoords::rflag1} to location at 36.5, 56.5, 883.5 of "{@world}"
- set {gamecoords::rset1} to "/setblock 36 56 883 minecraft:wall_banner 1 false {Base:1}"
- set {gamecoords::rspawn1} to location at 67.5, 57.5, 883.5 of "{@world}"
- #!map 2 - mushroom map
- #blue
- set {gamecoords::bflag2} to location at -660.5, 50.5, 77.5 of "{@world}"
- set {gamecoords::bset2} to "/setblock -661 50 77 minecraft:wall_banner 9 false {Base:4}"
- set {gamecoords::bspawn2} to location at -660.5, 40.5, 76.5 of "{@world}"
- #red
- set {gamecoords::rflag2} to location at -686.5, 50.5, -50.5 of "{@world}"
- set {gamecoords::rset2} to "/setblock -687 50 -51 minecraft:wall_banner 2 false {Base:1}"
- set {gamecoords::rspawn2} to location at -686.5, 40.5, -49.5 of "{@world}"
- function resetSide(color: text):
- if {_color} is "red":
- command "%{gamecoords::rset%{game::map}%}%"
- else if {_color} is "blue":
- command "%{gamecoords::bset%{game::map}%}%"
- function randomMap(b: boolean = true):
- set {game::map} to a random integer between 1 and {@maps}
- command "%{gamecoords::rset%{game::map}%}%"
- command "%{gamecoords::bset%{game::map}%}%"
- function getState(b: boolean = true) :: integer:
- return value of sql var "game::ctf{@gamenumber}::state" parsed as integer
- function getPlays(p: offlineplayer) :: integer:
- return value of sql var "stats::ctf::gamesplayed::%{_p}%" parsed as integer
- function tpLoc(p: player):
- set {_p}'s level to 0
- clear {_p}'s inventory
- if getState() is 3:
- evaluate "loadKit({_p})"
- if {game::team::%{_p}%} is "red":
- set {_loc} to {gamecoords::rspawn%{game::map}%}
- teleport {_p} to {_loc}
- set {_p} tab name to "&c%{_p}%"
- set {_p}'s helmet to a red wool
- else if {game::team::%{_p}%} is "blue":
- set {_loc} to {gamecoords::bspawn%{game::map}%}
- teleport {_p} to {_loc}
- set {_p} tab name to "&9%{_p}%"
- set {_p}'s helmet to a blue wool
- else:
- teleport {_p} to location at {@spawn} of the world "{@world}"
- set slot 2 of {_p} to a clock named "&7Team Selector"
- set slot 6 of {_p} to a gunpowder named "&7Kit Selector"
- if {game::multiplier} is not set:
- set slot 4 of {_p} to a glowing gold ingot named "&7Multipliers"
- on spawn:
- cancel the event
- on xp spawn:
- cancel the event
- on hunger meter change:
- cancel the event
- on skript load:
- delete {game::*}
- set sql var "game::ctf{@gamenumber}::state" to "1"
- set {game::nodamage} to true
- while true:
- wait 1 second
- if {game::time} is set:
- difference between {game::time} and now is greater than 30 seconds
- delete {game::time}
- getState() is 2
- set sql var "game::ctf{@gamenumber}::state" to "3"
- delete {game::nodamage}
- randomMap()
- loop all players:
- if {game::team::%loop-player%} is not set:
- if size of {game::blue::*} is less than size of {game::red::*}:
- set {game::team::%loop-player%} to "blue"
- set {game::blue::%loop-player%} to loop-player
- else:
- set {game::team::%loop-player%} to "red"
- set {game::red::%loop-player%} to loop-player
- tpLoc(loop-player)
- set sql var "stats::ctf::gamesplayed::%loop-player%" to "%getPlays(loop-player) + 1%"
- if getState() is 1:
- loop all players:
- set loop-player's action bar to "&7Need at least &e%4 - amount of players%&7 more players to start!"
- else if getState() is 2:
- loop all players:
- set {_time} to difference between {game::time} and now
- set {_time} to "%difference between {_time} and 30 second%"
- set {_time::*} to {_time} split at "."
- set {_time} to {_time::1} parsed as integer
- set loop-player's level to {_time}
- set loop-player's action bar to "&7Starting in &e%{_time}% seconds"
- command "/playsound random.click %loop-player% ~ ~ ~ 1 0.5 1"
- else if getState() is 3:
- wait 1 tick
- on right click on wall_banner or standing_banner:
- {game::nodamage} is not set
- player's gamemode is not spectator
- set {_team} to {game::team::%player%}
- set {_redflag} to {gamecoords::rflag%{game::map}%}
- set {_blueflag} to {gamecoords::bflag%{game::map}%}
- set {_loc} to {_%{_team}%flag}
- if "%nbt of clicked block%" contains "Base:1":
- if {_team} is "red":
- distance between {_loc} and clicked block is greater than 1
- broadcast "&c%player%&7 has returned the flag to the &cRed Base"
- resetSide("red")
- set clicked block to air
- else:
- set {_name} to "&cRed Flag"
- set {_item} to banner:1
- broadcast "&9%player%&7 is capturing the &cRed Flag"
- $ thread
- addCoins(player, 25)
- else:
- if {_team} is "blue":
- distance between {_loc} and clicked block is greater than 1
- broadcast "&9%player%&7 has returned the flag to the &9Blue Base"
- resetSide("blue")
- set clicked block to air
- else:
- set {_name} to "&9Blue Flag"
- set {_item} to a banner:4
- broadcast "&c%player%&7 is capturing the &9Blue Flag"
- $ thread
- addCoins(player, 25)
- {_name} is set
- if {game::capture::%player%} is not set:
- set clicked block to air
- set {game::capture::%player%} to {_name}
- set {game::contents::%player%} to serialized contents of player's inventory
- set {game::slot::%player%} to player's current hotbar slot
- loop 36 times:
- set slot loop-number - 1 of player to air
- set player's helmet to {_item} named {_name}
- set slot 4 of player to {_item} named {_name}
- set player's current hotbar slot to 4
- while {game::capture::%player%} is set:
- "%{game::capture::%player%}%" is not "<none>"
- set player's action bar to "&7Capturing &7the %{_name}%! &7Return it to your base to capture it!"
- set player's current hotbar slot to 4
- wait 5 ticks
- on join:
- set join message to ""
- heal player
- set player's gamemode to adventure
- tpLoc(player)
- if amount of players is less than 4:
- set sql var "game::ctf{@gamenumber}::state" to "1"
- delete {game::time}
- else if amount of players is greater than or equal to 4:
- getState() is not 2 or 3
- set sql var "game::ctf{@gamenumber}::state" to "2"
- set {game::time} to now
- wipe player's sidebar
- set name of sidebar of player to "&c&lCTF"
- set id score "&7PLAYERS" in sidebar of player to 8 with id "Players.%player%"
- set id score "&e%amount of players%/16" in sidebar of player to 7 with id "PlayerCount.%player%"
- set id score " " in sidebar of player to 6 with id "Space1.%player%"
- set id score "&9BLUE" in sidebar of player to 5 with id "Blue.%player%"
- set id score "&e%size of {game::blue::*}%" in sidebar of player to 4 with id "BlueCount.%player%"
- set id score "&cRED" in sidebar of player to 3 with id "Red.%player%"
- set id score "&e&e%size of {game::red::*}%" in sidebar of player to 2 with id "RedCount.%player%"
- set id score " " in sidebar of player to 1 with id "Space2.%player%"
- set id score "&ewww.minealot.net" in sidebar of player to 0 with id "Website.%player%"
- while sidebar name for player contains "CTF":
- wait 15 tick
- if player is not online:
- stop loop
- if sidebar name for player is "&c&lCTF":
- set name of sidebar of player to "&9&lCTF"
- else:
- set name of sidebar of player to "&c&lCTF"
- update score id "PlayerCount.%player%" to "&e%amount of players%/16" and 7
- update score id "BlueCount.%player%" to "&e%size of {game::blue::*}%" and 4
- update score id "RedCount.%player%" to "&e&e%size of {game::red::*}%" and 2
- on quit:
- delete {game::team::%player%}
- delete {game::blue::%player%}
- delete {game::red::%player%}
- if getState() is 3:
- kill player
- else if getState() is 1 or 2:
- if size of {game::blue::*} is greater than ceil(amount of players/2):
- while size of {game::blue::*} is greater than ceil(amount of players/2):
- set {_p} to a random element out of {game::blue::*}
- delete {game::team::%{_p}%}
- delete {game::blue::%{_p}%}
- else if size of {game::red::*} is greater than floor(amount of players/2):
- while size of {game::floor::*} is greater than floor(amount of players/2):
- set {_p} to a random element out of {game::floor::*}
- delete {game::floor::%{_p}%}
- delete {game::floor::%{_p}%}
- if amount of players is less than 4:
- set sql var "game::ctf{@gamenumber}::state" to "1"
- delete {game::time}
- wait 1 tick
- getState() is 3
- if size of {game::blue::*} is 0:
- set {_end} to true
- else if size of {game::red::*} is 0:
- set {_end} to true
- if {_end} is true:
- if {game::captures::red} is greater than {game::captures::blue}:
- loop all players:
- send loop-player title "&7The &c&lred&7 team has won!" for 5 seconds
- else if {game::captures::blue} is greater than {game::captures::red}:
- loop all players:
- send loop-player title "&7The &9&lblue&7 team has won!" for 5 seconds
- else:
- loop all players:
- send loop-player title "&7The game has ended in a tie!" for 5 seconds
- loop 10 times:
- loop all players:
- if loop-number is 1:
- {game::team::%loop-player%} is {_team}
- set {_wins} to value of sql var "stats::ctf::wins::%loop-player%" parsed as integer
- set sql var "stats::ctf::wins::%loop-player%" to "%{_wins} + 1%"
- command "/playsound fireworks.launch %loop-player% ~ ~ ~ 1 1 1"
- wait 10 ticks
- loop all players:
- send loop-player to "lobby1"#"lobby1-ctf"
- delete {game::*}
- set sql var "game::ctf{@gamenumber}::state" to "0"
- wait 10 seconds
- command "/stop"
- on drop:
- cancel the event
- on right click on a gold block:
- player's gamemode is not spectator
- {game::nodamage} is not set
- set {_team} to {game::team::%player%}
- {game::capture::%player%} is set
- set {_redflag} to {gamecoords::rflag%{game::map}%}
- set {_blueflag} to {gamecoords::bflag%{game::map}%}
- set {_loc} to {_%{_team}%flag}
- distance between player and {_loc} is less than 7
- add 1 to {game::captures::%{_team}%}
- broadcast "&e%player%&7 has captured &7the %{game::capture::%player%}% &7&o(%{game::captures::%{_team}%}%/3 captures for the %{_team}% team)"
- $ thread
- addCoins(player, 75)
- if {game::captures::%{_team}%} is greater than 3:
- set {game::captures::%{_team}%} to 0
- if {game::captures::%{_team}%} is 3:
- set {game::nodamage} to true
- if {game::captures::red} is greater than {game::captures::blue}:
- loop all players:
- send loop-player title "&7The &c&lred&7 team has won!" for 5 seconds
- else if {game::captures::blue} is greater than {game::captures::red}:
- loop all players:
- send loop-player title "&7The &9&lblue&7 team has won!" for 5 seconds
- loop 10 times:
- loop all players:
- if loop-number is 1:
- {game::team::%loop-player%} is {_team}
- set {_wins} to value of sql var "stats::ctf::wins::%loop-player%" parsed as integer
- set sql var "stats::ctf::wins::%loop-player%" to "%{_wins} + 1%"
- command "/playsound fireworks.launch %loop-player% ~ ~ ~ 1 1 1"
- wait 10 ticks
- loop all players:
- send loop-player to "lobby1"#"lobby1-ctf"
- delete {game::*}
- set sql var "game::ctf{@gamenumber}::state" to "0"
- wait 10 seconds
- command "/stop"
- if {_team} is "red":
- resetSide("blue")
- set player's helmet to a red wool
- else if {_team} is "blue":
- resetSide("red")
- set player's helmet to a blue wool
- restore inventory of player from {game::contents::%player%}
- set player's current hotbar slot to {game::slot::%player%}
- delete {game::capture::%player%}
- delete {game::contents::%player%}
- delete {game::slot::%player%}
- on right click holding a clock:
- name of player's tool is "&7Team Selector"
- cancel the event
- open chest with 1 row named "&7Team Selector" to player
- wait 1 tick
- while inventory name of player's current inventory is "&7Team Selector":
- set slot 2 of player's current inventory to a blue wool named "&9Blue:&e %size of {game::blue::*}%/%ceil(amount of players/2)%"
- set slot 6 of player's current inventory to a red wool named "&cRed:&e %size of {game::red::*}%/%ceil(amount of players/2)%"
- wait 2 ticks
- on inventory click:
- cancel the event
- if inventory name of player's current inventory is "&7Team Selector":
- if clicked item is a blue wool:
- size of {game::blue::*} is not ceil(amount of players/2)
- set {game::blue::%player%} to player
- set {game::team::%player%} to "blue"
- delete {game::red::%player%}
- send "&9You have joined the blue team"
- else if clicked item is a red wool:
- size of {game::red::*} is not ceil(amount of players/2)
- set {game::red::%player%} to player
- set {game::team::%player%} to "red"
- delete {game::blue::%player%}
- send "&cYou have joined the red team"
- on gamemode change:
- player's gamemode is not adventure or spectator
- set player's gamemode to adventure
- on skript stop:
- delete {game::*}
- on skript load:
- command "/save-off"
- on break:
- cancel the event
- on place:
- cancel the event
- on form:
- cancel the event
- on projectile hit:
- wait 15 seconds
- delete projectile
- on damage of a player:
- if {game::nodamage} is true:
- cancel the event
- else if attacker's helmet is a banner:
- cancel the event
- else if {game::team::%victim%} is {game::team::%attacker%}:
- cancel the event
- else if damage cause is fall:
- set damage to damage*0.66
- else if damage cause is void:
- if victim's gamemode is spectator:
- teleport victim to location 100 above victim
- else:
- kill victim
- on death of a player:
- set death message to ""
- clear drops
- getState() is 3
- set {_deaths} to value of sql var "stats::ctf::deaths::%victim%" parsed as integer
- set sql var "stats::ctf::deaths::%victim%" to "%{_deaths} + 1%"
- if {game::capture::%victim%} is set:
- if y-coordinate of victim is less than 0:
- broadcast "&7%victim% died while carrying &7the %{game::capture::%player%}%"
- broadcast "&7The flag has been returned because &a%victim%&7 has died in the void!"
- if {game::capture::%victim%} is "&cRed Flag":
- resetSide("red")
- else:
- resetSide("blue")
- else:
- if "%horizontal facing of victim%" is "east":
- set {_data} to 12
- else if "%horizontal facing of victim%" is "north":
- set {_data} to 8
- else if "%horizontal facing of victim%" is "west":
- set {_data} to 4
- else:
- set {_data} to 0
- if {game::capture::%victim%} is "&cRed Flag":
- broadcast "&9%victim% died while carrying &7the %{game::capture::%player%}%"
- command "/setblock %floor(victim's x-coordinate)% %floor(victim's y-coordinate)% %floor(victim's z-coordinate)% minecraft:standing_banner %{_data}% false {Base:1}"
- else:
- broadcast "&c%victim% died while carrying &7the %{game::capture::%player%}%"
- command "/setblock %floor(victim's x-coordinate)% %floor(victim's y-coordinate)% %floor(victim's z-coordinate)% minecraft:standing_banner %{_data}% false {Base:4}"
- broadcast "&7Death coordinates: %floor(x-coordinate of victim)%, %floor(y-coordinate of victim)%, %floor(z-coordinate of victim)%"
- if attacker is a player:
- if {game::team::%victim%} is "red":
- send "&7You killed &c%victim%" to attacker
- send "&9%attacker%&7 killed you" to victim
- else:
- send "&7You killed &9%victim%" to attacker
- send "&c%attacker%&7 killed you" to victim
- heal attacker by 2.5 hearts
- apply regeneration 2 to attacker for 5 seconds
- command "/playsound note.harp %attacker% ~ ~ ~ 1 1 1"
- $ thread
- addCoins(attacker, 15)
- $ thread
- set {_kills} to value of sql var "stats::ctf::kills::%attacker%" parsed as integer
- $ thread
- set sql var "stats::ctf::kills::%attacker%" to "%{_kills} + 1%"
- delete {game::capture::%victim%}
- add 0.34 to {game::respawn::%victim%}
- set {_loc} to location at victim
- wait 5 ticks
- force respawn victim
- wait 1 tick
- clear player's inventory
- set victim's gamemode to spectator
- hide victim from all players
- wait 1 tick
- teleport victim to {_loc}
- wait 10 ticks
- loop 4 + floor({game::respawn::%victim%}) times:
- set victim's action bar to "&7&lRESPAWNING IN &e&l%(5 + floor({game::respawn::%victim%})) - loop-number%"
- command "/playsound note.bass %victim% ~ ~ ~ 0.1 0.7 0.1"
- loop 20 times:
- wait 1 tick
- set is flying of victim to true
- set victim's gamemode to adventure
- reveal victim to all players
- tpLoc(victim)
- on right click holding a gold ingot:
- cancel the event
- open chest with 1 row named "&7Multipliers" to player
- wait 1 tick
- set {_2} to value of sql var "multipliers::double::%player%" parsed as integer
- set {_3} to value of sql var "multipliers::triple::%player%" parsed as integer
- set {_4} to value of sql var "multipliers::quadruple::%player%" parsed as integer
- if "%{_2}%" is "<none>" or "0":
- set slot 2 of player's current inventory to a gold nugget named "&7Double Coins Multiplier:&e 0"
- else:
- set slot 2 of player's current inventory to a gold nugget named "&7Double Coins Multiplier:&e %{_2}%" with lore "&7Click to activate double coins multiplier for this game!"
- if "%{_3}%" is "<none>" or "0":
- set slot 4 of player's current inventory to a gold ingot named "&7Triple Coins Multiplier:&e 0"
- else:
- set slot 4 of player's current inventory to a gold ingot named "&7Triple Coins Multiplier:&e %{_3}%" with lore "&7Click to activate triple coins multiplier for this game!"
- if "%{_4}%" is "<none>" or "0":
- set slot 6 of player's current inventory to a gold block named "&7Quadruple Coins Multiplier:&e 0"
- else:
- set slot 6 of player's current inventory to a gold block named "&7Quadruple Coins Multiplier:&e %{_4}%" with lore "&7Click to activate quadruple coins multiplier for this game!"
- on inventory click:
- cancel the event
- inventory name of player's current inventory is "&7Multipliers"
- clicked item is not air
- set {_2} to value of sql var "multipliers::double::%player%" parsed as integer
- set {_3} to value of sql var "multipliers::triple::%player%" parsed as integer
- set {_4} to value of sql var "multipliers::quadruple::%player%" parsed as integer
- if clicked item is a gold nugget:
- if lore of clicked item does not contain "&7Click":
- send "&7You have no Double Coins Multiplier to activate"
- else:
- broadcast "&e%player%&7 has activated a Double Coins Multiplier"
- command "/playsound random.levelup @a"
- set {game::multiplier} to player
- set {game::multiplier::amount} to 2
- remove all gold ingot from inventory of all players
- set sql var "multipliers::double::%player%" to "%{_2} - 1%"
- send "&7You now have &e%{_2} - 1%&7 Double Coins Multiplier left!"
- loop all players:
- inventory name of loop-player's current inventory is "&7Multipliers"
- close loop-player's inventory
- else if clicked item is a gold ingot:
- if lore of clicked item does not contain "&7Click":
- send "&7You have no Triple Coins Multiplier to activate"
- else:
- broadcast "&e%player%&7 has activated a Triple Coins Multiplier"
- command "/playsound random.levelup @a"
- set {game::multiplier} to player
- set {game::multiplier::amount} to 3
- remove all gold ingot from inventory of all players
- set sql var "multipliers::triple::%player%" to "%{_3} - 1%"
- send "&7You now have &e%{_3} - 1%&7 Triple Coins Multiplier left!"
- loop all players:
- inventory name of loop-player's current inventory is "&7Multipliers"
- close loop-player's inventory
- else if clicked item is a gold block:
- if lore of clicked item does not contain "&7Click":
- send "&7You have no Quadruple Coins Multiplier to activate"
- else:
- broadcast "&e%player%&7 has activated a Quadruple Coins Multiplier"
- command "/playsound random.levelup @a"
- set {game::multiplier} to player
- set {game::multiplier::amount} to 4
- remove all gold ingot from inventory of all players
- set sql var "multipliers::quadruple::%player%" to "%{_4} - 1%"
- send "&7You now have &e%{_4} - 1%&7 Quadruple Coins Multiplier left!"
- loop all players:
- inventory name of loop-player's current inventory is "&7Multipliers"
- close loop-player's inventory
- on respawn:
- tpLoc(player)
- on tool change:
- {game::capture::%player%} is set
- cancel the event
- set player's current hotbar slot to 4
- wait 1 tick
- set player's current hotbar slot to 4
Add Comment
Please, Sign In to add comment