Files
dash_weapons.sk
spearmace_ffa.sk
Code
2 389
spearmace_ffa.sk
# SpearMace FFA
# Put this file in plugins/Skript/scripts/
# Set the arena spawn before using /spearmace join.
options:
mace-name: &6&l✦ &e&lDASH MACE &6&l✦
spear-name: &a&l✦ &2&lDASH SPEAR &a&l✦
mace-cooldown: 10
spear-cooldown: 5
function spearmace-give-kit(p: player):
clear {_p}'s inventory
set {_mace} to a mace named "{@mace-name}"
set unbreakable state of {_mace} to true
set lore of {_mace} to "&6&lRIGHT-CLICK &7to launch upward", "&7COOLDOWN: &f{@mace-cooldown} seconds", "", "&7When in main hand:", "&a+8 Attack Damage", "&a1.6 Attack Speed"
enchant {_mace} with density 5
enchant {_mace} with wind burst 3
enchant {_mace} with unbreaking 3
enchant {_mace} with fire aspect 2
set {_spear} to a netherite spear named "{@spear-name}"
set unbreakable state of {_spear} to true
set lore of {_spear} to "&a&lSHIFT + RIGHT-CLICK &7to charge forward", "&7COOLDOWN: &f{@spear-cooldown} seconds", "", "&7When in main hand:", "&a+8 Attack Damage", "&a0.87 Attack Speed"
enchant {_spear} with sharpness 5
enchant {_spear} with lunge 3
enchant {_spear} with unbreaking 3
give {_mace} to {_p}
give {_spear} to {_p}
give 16 cooked beef to {_p}
set slot 0 of {_p}'s inventory to {_mace}
set slot 1 of {_p}'s inventory to {_spear}
command /spearmace [<text>]:
trigger:
if arg-1 is not set:
send "&5&lSPEARMACE FFA" to player
send "&7/spearmace join &8- &fJoin the FFA" to player
send "&7/spearmace leave &8- &fLeave the FFA" to player
send "&7/spearmace stats &8- &fView your stats" to player
if player has permission "spearmace.admin":
send "&7/spearmace setspawn &8- &fSet the FFA spawn" to player
send "&7/spearmace setlobby &8- &fSet the leave location" to player
stop
if arg-1 is "join":
if {spearmace.spawn} is not set:
send "&cThe SpearMace FFA spawn has not been set yet." to player
stop
if {spearmace.ffa::%uuid of player%} is true:
send "&eYou are already in SpearMace FFA." to player
stop
if {spearmace.kills::%uuid of player%} is not set:
set {spearmace.kills::%uuid of player%} to 0
if {spearmace.deaths::%uuid of player%} is not set:
set {spearmace.deaths::%uuid of player%} to 0
if {spearmace.streak::%uuid of player%} is not set:
set {spearmace.streak::%uuid of player%} to 0
set {spearmace.ffa::%uuid of player%} to true
teleport player to {spearmace.spawn}
spearmace-give-kit(player)
send "&5&lSPEARMACE FFA &8» &fYou joined the arena." to player
send "&7Fight everyone, and use &eSHIFT + RIGHT-CLICK &7with the spear to charge." to player
stop
if arg-1 is "leave":
if {spearmace.ffa::%uuid of player%} is not true:
send "&cYou are not in SpearMace FFA." to player
stop
delete {spearmace.ffa::%uuid of player%}
if {spearmace.lobby} is set:
teleport player to {spearmace.lobby}
send "&5&lSPEARMACE FFA &8» &fYou left the arena." to player
stop
if arg-1 is "stats":
set {_kills} to {spearmace.kills::%uuid of player%}
set {_deaths} to {spearmace.deaths::%uuid of player%}
set {_streak} to {spearmace.streak::%uuid of player%}
if {_kills} is not set:
set {_kills} to 0
if {_deaths} is not set:
set {_deaths} to 0
if {_streak} is not set:
set {_streak} to 0
send "&8&m------------------------------" to player
send "&5&lSPEARMACE FFA &7Stats" to player
send "&7Kills: &d%{_kills}%" to player
send "&7Deaths: &d%{_deaths}%" to player
send "&7Current streak: &d%{_streak}%" to player
send "&8&m------------------------------" to player
stop
if arg-1 is "setspawn":
if player does not have permission "spearmace.admin":
send "&cYou do not have permission to do that." to player
stop
set {spearmace.spawn} to location of player
send "&aSpearMace FFA spawn set." to player
stop
if arg-1 is "setlobby":
if player does not have permission "spearmace.admin":
send "&cYou do not have permission to do that." to player
stop
set {spearmace.lobby} to location of player
send "&aSpearMace FFA lobby set." to player
stop
send "&cUnknown option. Use &f/spearmace &cfor help." to player
on right click:
if {spearmace.ffa::%uuid of player%} is not true:
stop
if player's tool is a mace:
if name of player's tool is "{@mace-name}":
cancel event
if player is not on ground:
stop
if {spearmace.mace.cooldown::%uuid of player%} is set:
if difference between now and {spearmace.mace.cooldown::%uuid of player%} is less than {@mace-cooldown} seconds:
set {_left} to {@mace-cooldown} - floor((difference between now and {spearmace.mace.cooldown::%uuid of player%}) / 1 second)
send action bar "&6Dash Mace &7is on cooldown &8(&f%{_left}%s&8)" to player
stop
set {spearmace.mace.cooldown::%uuid of player%} to now
wait 1 tick
push player upwards at speed 6
stop
if player's tool is a netherite spear:
if name of player's tool is "{@spear-name}":
if player is not sneaking:
stop
cancel event
if {spearmace.spear.cooldown::%uuid of player%} is set:
if difference between now and {spearmace.spear.cooldown::%uuid of player%} is less than {@spear-cooldown} seconds:
set {_left} to {@spear-cooldown} - floor((difference between now and {spearmace.spear.cooldown::%uuid of player%}) / 1 second)
send action bar "&aDash Spear &7is on cooldown &8(&f%{_left}%s&8)" to player
stop
set {spearmace.spear.cooldown::%uuid of player%} to now
push player in direction of player at speed 5
on damage:
if victim is a player:
if {spearmace.ffa::%uuid of victim%} is true:
if attacker is not a player:
cancel event
stop
if {spearmace.ffa::%uuid of attacker%} is not true:
cancel event
stop
if world of attacker is not world of victim:
cancel event
stop
if attacker's tool is a mace:
if name of attacker's tool is "{@mace-name}":
if fall distance of attacker is greater than 2:
set {_bonus} to fall distance of attacker * 2
increase damage by {_bonus}
set fall distance of attacker to 0
if attacker's tool is a netherite spear:
if name of attacker's tool is "{@spear-name}":
increase damage by 3
on death of player:
if {spearmace.ffa::%uuid of player%} is not true:
stop
set death message to ""
clear drops
add 1 to {spearmace.deaths::%uuid of player%}
set {spearmace.streak::%uuid of player%} to 0
if attacker is a player:
if {spearmace.ffa::%uuid of attacker%} is true:
add 1 to {spearmace.kills::%uuid of attacker%}
add 1 to {spearmace.streak::%uuid of attacker%}
set {_streak} to {spearmace.streak::%uuid of attacker%}
send action bar "&a&lKILL &8» &f%attacker% &7killed &f%player% &8| &dStreak: %{_streak}%" to attacker
loop all players:
if {spearmace.ffa::%uuid of loop-player%} is true:
send "&5&lFFA &8» &d%attacker% &7eliminated &d%player%&7." to loop-player
on respawn:
if {spearmace.ffa::%uuid of player%} is true:
if {spearmace.spawn} is set:
set respawn location to {spearmace.spawn}
wait 1 tick
spearmace-give-kit(player)
every 1 second:
loop all players:
if {spearmace.ffa::%uuid of loop-player%} is true:
set {_mace-left} to 0
set {_spear-left} to 0
if {spearmace.mace.cooldown::%uuid of loop-player%} is set: