#————————————————————————————————DO NOT REMOVE THIS SECTION————————————————————————————————# # MADE BY: BANDITEAGLE # DISCORD: @BanditEagl3#4375 # GUILDED.GG: @BanditEagle # MINEHUT FORUMS PROFILE: https://forums.minehut.com/profile/276950-banditeagle/ # SPIGOT PROFILE: https://www.spigotmc.org/members/banditeagle.935281/ # SKUNITY PROFILE: https://forums.skunity.com/members/banditeagle.16100/ # You are allowed to share this skript, but please mention that this is made by me. # combatNspawn.sk v.1.0 #————————————————————————————————DO NOT REMOVE THIS SECTION————————————————————————————————# options: combatTagTime: 15 #The time needed until combat tag is removed (in seconds) spawnCountdown: 100 #The time needed until you can teleport to spawn (in ticks, 100 ticks = 5 seconds) spawnCountdownMsg: "&6You will be teleported to spawn in second(s)." #Message players receive when using /spawn tagMsg: "&6You are now in combat" #Message players receive when they get in combat noTagMsg: "&6You are no longer in combat" #Message players receive when they aren't in combat killMsg: "&6 has been killed by " #Broadcasted message when a player kills another player killstreakMsg: "&6 has a kill streak!" #Broadcasted message every 5 killstreaks killCountMsg: "&6 has number of kills!" #Message used with the command /kills skRayFallON: false #When this is set to true, boss bar and action bar will be used, but requires SkRayFall. If this is set to false, does not need the SkRayFall plugin. onlyPlayersCanTag: true #When this is set to true, combat tag will only activate if both the attacker and the victim are players. If this is set to false, damage from other entities will activate combat tag as well. on unload: clear {combatTag::*} clear {newTag::*} clear {noMsg::*} clear {lastCombat::*} clear {killStreak::*} clear {deathStatus::*} clear {deathList::*} on load: clear {combatTag::*} clear {newTag::*} clear {noMsg::*} clear {lastCombat::*} clear {killStreak::*} clear {deathStatus::*} clear {deathList::*} set {_int} to 100 loop 100 times: add {_int} to {deathList::*} remove 1 from {_int} on first join: teleport player to {spawn} on join: clear {combatTag::%player%} clear {newTag::%player%} clear {noMsg::%player%} clear {lastCombat::%player%} clear {killStreak::%player%} clear {deathStatus::%player%} teleport player to {spawn} on leave: clear {combatTag::%player%} clear {newTag::%player%} clear {noMsg::%player%} clear {lastCombat::%player%} clear {killStreak::%player%} clear {deathStatus::%player%} on damage of player: if {@onlyPlayersCanTag} is true: attacker is a player #For victim if {combatTag::%victim%} is not set: set {combatTag::%victim%} to true clear {newTag::%victim%} set {lastCombat::%victim%} to attacker if {noMsg::%victim%} is not set: send {@tagMsg} to victim InCombat(victim, "first") else if {combatTag::%victim%} is set: set {noMsg::%victim%} to true clear {combatTag::%victim%} set {newTag::%victim%} to true InCombat(victim, "new") #For attacker if {@onlyPlayersCanTag} is true: if {combatTag::%attacker%} is not set: set {combatTag::%attacker%} to true clear {newTag::%attacker%} if {noMsg::%attacker%} is not set: send {@tagMsg} to attacker InCombat(attacker, "first") else if {combatTag::%attacker%} is set: set {noMsg::%attacker%} to true clear {combatTag::%attacker%} set {newTag::%attacker%} to true InCombat(attacker, "new") on death of player: if {skRayFallON} is true: remove bossbar "cTagTimer.%{_p}%" clear {killStreak::%victim%} set {deathStatus::%victim%} to true if {combatTag::%victim%} is set: set {_killer} to {lastCombat::%victim%} clear {combatTag::%victim%} clear {lastCombat::%victim%} add 1 to {killCount::%{_killer}'s uuid%} add 1 to {killStreak::%{_killer}%} if {killStreak::%{_killer}%} >= 5: set {_ksamount} to floor(({killStreak::%{_killer}%})/5) if {deathList::%{_ksamount}%::%{_killer}%} is not set: set {deathList::%{_ksamount}%::%{_killer}%} to true set {_killstreak} to 5*{_ksamount} set {_broadcast} to {@killstreakMsg} replace "" in {_broadcast} with "%{_killer}%" replace "" in {_broadcast} with "%{_ksamount}%" broadcast "%{_broadcast}%" on respawn: clear {deathStatus::%player%} function InCombat(p: player, state: text): set {_seconds} to 10*{@combatTagTime} if {@skRayFallON} is true: remove bossbar "cTagTimer.%{_p}%" set {_bossbartimer} to 100 set {_timerremover} to ({_bossbartimer}/{_seconds}) create bossbar titled "Combat Tag Timer" and id "cTagTimer.%{_p}%" for {_p} with progress {_bossbartimer} with colors red if {_state} is "first": while {_seconds} > 0: if {newTag::%{_p}%} is set: stop wait 2 ticks if {@skRayFallON} is true: remove {_timerremover} from {_bossbartimer} set bossbar "cTagTimer.%{_p}%" value to {_bossbartimer} remove 1 from {_seconds} if {@skRayFallON} is true: remove bossbar "cTagTimer.%{_p}%" clear {combatTag::%{_p}%} clear {newTag::%{_p}%} clear {noMsg::%{_p}%} send {@noTagMsg} to {_p} if {_state} is "new": while {_seconds} > 0: if {combatTag::%{_p}%} is set: stop wait 2 ticks if {@skRayFallON} is true: remove {_timerremover} from {_bossbartimer} set bossbar "cTagTimer.%{_p}%" value to {_bossbartimer} remove 1 from {_seconds} if {@skRayFallON} is true: remove bossbar "cTagTimer.%{_p}%" clear {combatTag::%{_p}%} clear {newTag::%{_p}%} clear {noMsg::%{_p}%} send {@noTagMsg} to {_p} command /setspawn: permission: spawn.set permission message: &cYou do not have access to this command" trigger: set {spawn} to player's location send "&aSpawn has been set to: &2%{spawn}%" command /spawn: trigger: set {_countdown} to {@spawnCountdown} set {_loc} to location of player set {_seconds} to floor(({_countdown})/20) set {_int} to {_seconds} loop {_seconds} times: add {_int} to {_list::*} remove 1 from {_int} while {_countdown} is not 0: if distance between {_loc} and player is not 0: loop {_seconds} times: if {@skRayFallON} is true: send action bar "&cCanceling teleport to spawn: Cannot teleport when moving." to player else: send "&cCanceling teleport to spawn: Cannot teleport when moving." stop if {combatTag::%player%} is set: loop {_seconds} times: send action bar "&cCanceling teleport to spawn: Cannot teleport when in combat." to player stop if {newTag::%player%} is set: loop {_seconds} times: if {@skRayFallON} is true: send action bar "&cCanceling teleport to spawn: Cannot teleport when in combat." to player else: send "&cCanceling teleport to spawn: Cannot teleport when in combat." stop if {deathStatus::%player%} is set: loop {_seconds} times: if {@skRayFallON} is true: send action bar "&cCanceling teleport to spawn: Cannot teleport when respawning." to player else: send "&cCanceling teleport to spawn: Cannot teleport when respawning." stop set {_int} to ({_countdown}/20) if {_list::*} contains {_int}: set {_msg} to {@spawnCountdownMsg} replace "" in {_msg} with "%{_int}%" if {@skRayFallON} is true: send action bar "%{_msg}%" to player else: send "%{_msg}%" remove 1 from {_countdown} wait a tick send "&6Teleporting you to spawn, please be patient." teleport player to {spawn} command /kills []: trigger: set {_msg} to {@killCountMsg} if arg-1 is set: set {_p} to arg-1 else: set {_p} to player set {_kills} to size of {killCount::%{_p}'s uuid%} replace "" in {_msg} with "%{_p}%" replace "" in {_msg} with "%{_kills}%" send "%{_msg}%"