Files
valorant.sk
Code
1 445
valorant.sk
options:
prefix: &c&lVALORANT &8» &r
max-credits: 9000
on script load:
set {v.phase} to "waiting"
delete {v.planted}
command /valorant [<text>] [<text>]:
trigger:
if arg-1 is "join":
if arg-2 is not "attackers" and arg-2 is not "defenders":
send "{@prefix}&cUsage: /valorant join <attackers|defenders>" to player
stop
if {v.phase} is "buy" or {v.phase} is "combat":
send "{@prefix}&cYou cannot change teams during a match." to player
stop
set {v.team::%uuid of player%} to arg-2
if {v.credits::%uuid of player%} is not set:
set {v.credits::%uuid of player%} to 800
send "{@prefix}&aYou joined the &f%arg-2%&a team." to player
stop
if arg-1 is "start":
if player does not have permission "valorant.admin":
send "{@prefix}&cYou don't have permission." to player
stop
set {_attackers} to 0
set {_defenders} to 0
loop all players:
if {v.team::%uuid of loop-player%} is "attackers":
add 1 to {_attackers}
if {v.team::%uuid of loop-player%} is "defenders":
add 1 to {_defenders}
if {_attackers} < 1 or {_defenders} < 1:
send "{@prefix}&cAt least one online player is needed on each team." to player
stop
set {v.score::attackers} to 0
set {v.score::defenders} to 0
set {v.round} to 0
startRound()
stop
if arg-1 is "setspawn":
if player does not have permission "valorant.admin":
send "{@prefix}&cYou don't have permission." to player
stop
if arg-2 is not "attackers" and arg-2 is not "defenders":
send "{@prefix}&cUsage: /valorant setspawn <attackers|defenders>" to player
stop
set {v.spawn::%arg-2%} to location of player
send "{@prefix}&aSet the &f%arg-2%&a spawn here." to player
stop
if arg-1 is "setsite":
if player does not have permission "valorant.admin":
send "{@prefix}&cYou don't have permission." to player
stop
if arg-2 is not "a" and arg-2 is not "b":
send "{@prefix}&cUsage: /valorant setsite <a|b>" to player
stop
set {v.site::%arg-2%} to location of player
send "{@prefix}&aSet Site %arg-2% here." to player
stop
if arg-1 is "help" or arg-1 is not set:
send "&c&lVALORANT &7Commands:" to player
send "&f/valorant join <attackers|defenders> &7- Join a team" to player
send "&f/buy &7- Open the buy menu during buy phase" to player
send "&f/valorant reload &7- Reload your weapon" to player
send "&f/valorant start &7- Start a match (admin)" to player
send "&f/valorant setspawn <attackers|defenders> &7- Set a spawn (admin)" to player
send "&f/valorant setsite <a|b> &7- Set a plant site (admin)" to player
stop
if arg-1 is "reload":
if {v.phase} is not "combat":
send "{@prefix}&cYou can only reload during combat." to player
stop
if name of player's tool is "&fGhost":
set {v.ammo::%uuid of player%::ghost} to 12
send "{@prefix}&aGhost reloaded." to player
stop
if name of player's tool is "&fVandal":
set {v.ammo::%uuid of player%::vandal} to 25
send "{@prefix}&aVandal reloaded." to player
stop
send "{@prefix}&cHold a Ghost or Vandal to reload." to player
stop
send "{@prefix}&cUnknown subcommand. Use /valorant help." to player
command /buy:
trigger:
if {v.phase} is not "buy":
send "{@prefix}&cThe buy menu is only available during the buy phase." to player
stop
set {_menu} to chest inventory with 3 rows named "&8VALORANT Buy Menu"
set slot 10 of {_menu} to wooden sword named "&fGhost" with lore "&7Pistol | 12 rounds" and "&eCost: 500 credits"
set slot 11 of {_menu} to iron sword named "&fVandal" with lore "&7Rifle | 25 rounds" and "&eCost: 2900 credits"
set slot 12 of {_menu} to iron chestplate named "&9Heavy Shield" with lore "&7Heavy armor" and "&eCost: 1000 credits"
set slot 14 of {_menu} to feather named "&bJett: Tailwind" with lore "&7Right-click for a speed burst" and "&eCost: 300 credits"
set slot 15 of {_menu} to blue dye named "&bJett: Cloudburst" with lore "&7Right-click to blind nearby enemies" and "&eCost: 300 credits"
set slot 16 of {_menu} to blaze powder named "&cPhoenix: Hot Hands" with lore "&7Right-click to damage nearby enemies" and "&eCost: 300 credits"
set slot 22 of {_menu} to blaze rod named "&cPhoenix: Blaze" with lore "&7Right-click to hinder nearby enemies" and "&eCost: 300 credits"
open {_menu} to player
on inventory click:
if name of event-inventory is "&8VALORANT Buy Menu":
cancel event
if {v.phase} is not "buy":
close player's inventory
stop
if clicked slot is 10:
if {v.credits::%uuid of player%} < 500:
send "{@prefix}&cYou need 500 credits." to player
stop
remove 500 from {v.credits::%uuid of player%}
give player a wooden sword named "&fGhost"
set {v.ammo::%uuid of player%::ghost} to 12
send "{@prefix}&aPurchased Ghost." to player
else if clicked slot is 11:
if {v.credits::%uuid of player%} < 2900:
send "{@prefix}&cYou need 2900 credits." to player
stop
remove 2900 from {v.credits::%uuid of player%}
give player an iron sword named "&fVandal"
set {v.ammo::%uuid of player%::vandal} to 25
send "{@prefix}&aPurchased Vandal." to player
else if clicked slot is 12:
if {v.credits::%uuid of player%} < 1000:
send "{@prefix}&cYou need 1000 credits." to player
stop
remove 1000 from {v.credits::%uuid of player%}
give player an iron chestplate named "&9Heavy Shield"
send "{@prefix}&aPurchased Heavy Shield." to player
else if clicked slot is 14:
if {v.credits::%uuid of player%} < 300:
send "{@prefix}&cYou need 300 credits." to player
stop
remove 300 from {v.credits::%uuid of player%}
give player a feather named "&bJett: Tailwind"
send "{@prefix}&aPurchased Tailwind." to player
else if clicked slot is 15:
if {v.credits::%uuid of player%} < 300:
send "{@prefix}&cYou need 300 credits." to player
stop
remove 300 from {v.credits::%uuid of player%}
give player a blue dye named "&bJett: Cloudburst"
send "{@prefix}&aPurchased Cloudburst." to player
else if clicked slot is 16:
if {v.credits::%uuid of player%} < 300:
send "{@prefix}&cYou need 300 credits." to player
stop
remove 300 from {v.credits::%uuid of player%}
give player a blaze powder named "&cPhoenix: Hot Hands"
send "{@prefix}&aPurchased Hot Hands." to player
else if clicked slot is 22:
if {v.credits::%uuid of player%} < 300:
send "{@prefix}&cYou need 300 credits." to player
stop
remove 300 from {v.credits::%uuid of player%}
give player a blaze rod named "&cPhoenix: Blaze"
send "{@prefix}&aPurchased Blaze." to player
function startRound():
add 1 to {v.round}
set {v.phase} to "buy"
set {v.timer} to 30
delete {v.planted}
delete {v.spike.location}
loop all players:
if {v.team::%uuid of loop-player%} is set:
delete {v.dead::%uuid of loop-player%}
clear loop-player's inventory
set loop-player's gamemode to survival
set loop-player's health to 20
set loop-player's food level to 20
set {_team} to {v.team::%uuid of loop-player%}
if {v.spawn::%{_team}%} is set:
teleport loop-player to {v.spawn::%{_team}%}
if {_team} is "attackers":
give loop-player a nether star named "&c&lSPIKE"
set score of "&eCredits" in sidebar of loop-player to {v.credits::%uuid of loop-player%}
set score of "&fRound" in sidebar of loop-player to {v.round}
if {_team} is "attackers":
set score of "&cAttackers" in sidebar of loop-player to 1
else:
set score of "&bDefenders" in sidebar of loop-player to 1
set score of "&6Timer" in sidebar of loop-player to 30
send "{@prefix}&eRound %{v.round}% begins. Buy phase: 30 seconds." to loop-player
loop 30 times:
if {v.phase} is not "buy":
stop
set {v.timer} to 31 - loop-number
loop all players:
if {v.team::%uuid of loop-player%} is set:
set score of "&eCredits" in sidebar of loop-player to {v.credits::%uuid of loop-player%}
set score of "&6Timer" in sidebar of loop-player to {v.timer}