Code:
# Killstreak.sk
# Killstreak tracker with randomized broadcast messages every 5 kills
variables:
[CODE]{killstreaks::} = 0
# --- Killstreak System ---
on death of a player:
attacker is a player
victim is a player
# Increase attacker's killstreak
add 1 to {killstreaks::%attacker%}
set {_streak} to {killstreaks::%attacker%}
# Send message to attacker
send "&aYou are on a killstreak of &e%{_streak}%!" to attacker
# Randomized broadcast every 5 kills: 5, 10, 15, 20, ...
if {_streak} mod 5 = 0:
set {killstreakmsgs::*} to
"&c⚔ %attacker% is going wild with &e%{_streak}% kills in a row!",
"&6 %attacker% is dominating with a &e%{_streak}x killstreak!",
"&b No one can stop %attacker%! &7(&e%{_streak}% kills&7)",
"&d %attacker% is a beast! &e%{_streak}% kills and counting!",
"&4‼ %attacker% just hit a &e%{_streak}x killstreak&4. This is getting dangerous!"
# Select a random message from the killstreak list
set {_message} to random element out of {killstreakmsgs::*}
# Broadcast the message to all players
broadcast "%{_message}%"
# Reset victim's killstreak
if {killstreaks::%victim%} is set:
set {_lost} to {killstreaks::%victim%}
send "&7Your killstreak of &c%{_lost}% &7has ended." to victim
delete {killstreaks::%victim%}