Solved Need help with killstreak skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

tumm

Supporter
Aug 4, 2019
6
0
1
22
Hey so I've made a killstreak skript but I want to broadcast a message each time a player get a killstreak of 5 (or 10,15,20 etc etc +5 each time) But I have no clue how to. My code:

Code:
options:
    prefix: &8[&9Killstreak&8]&r


    you_killed_player: &7You killed &6%victim%&7.
    your_killstreak_after_kill: &7Killstreak: &e%{rav::killstreak::%attacker%}%&7.
    you_died_with_a_killstreak: &7You died with a killstreak on &6%{rav::killstreak::%victim%}% kills&7.
    player_now_has_a_killstreak: &e%attacker% &aNow has a killstreak of &6%{rav::killstreak::%attacker%}% kills.
    number_between_killstreaks: 2

on join:
    if {rav::killstreak2::%player%} is not set:
        set {rav::killstreak2::%player%} to {@number_between_killstreaks}

on death of player:
    if attacker is a player:
        add 1 to {rav::killstreak::%attacker%}
        send "{@prefix} {@you_killed_player}" to attacker
        send "{@prefix} {@your_killstreak_after_kill}" to attacker
    if {rav::killstreak::%victim%} is set:
        send "{@prefix} {@you_died_with_a_killstreak}" to victim
        delete  {rav::killstreak::%victim%}
        delete {rav::kilstreakper5::%victim%}
    if {rav::killstreak::%attacker%} is {rav::killstreak2::%attacker%}:
        add {@number_between_killstreaks} to {rav::killstreak2::%attacker%}
    if {rav::killstreak::%attacker%} is equal to 2:
        broadcast "&6%attacker% &7now has a killstreak of &e%{rav::killstreak::%attacker%}%"
    if {rav::killstreak::%attacker%} is equal to 4:
        broadcast "&6%attacker% &7now has a killstreak of &e%{rav::killstreak::%attacker%}%"

command /killstreakreset [<player>]:
    aliases: /ksr
    trigger:
        if arg-1 is not set:
            send "&7Please give an username"
        if arg-1 is set:
            set {rav::killstreak::%arg-1%} to 0
            set {rav::killstreakper5::%arg-1%} to 0
            send "&6%arg-1%'s &7killstreak has been reset!"
[CODE]
 
Code:
on death:
    if attacker is set:
        loop {rav::killstreak::%attacker%} times:
            if mod( loop-value, 5 ) is 0:
                # remainder is 0, so we should broadcast
                broadcast "%attacker% got a killstreak of %{rav::killstreak::%attacker%}%"

# pseudo code

Something like this

Thank you very much!
 
Status
Not open for further replies.