1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Need help with killstreak skript

Discussion in 'Skript' started by Moonl1ght, Aug 13, 2019.

Thread Status:
Not open for further replies.
  1. Moonl1ght

    Moonl1ght Member

    Joined:
    Aug 4, 2019
    Messages:
    6
    Likes Received:
    0
    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 (Text):
    1.  
    2. options:
    3.     prefix: &8[&9Killstreak&8]&r
    4.  
    5.  
    6.     you_killed_player: &7You killed &6%victim%&7.
    7.     your_killstreak_after_kill: &7Killstreak: &e%{rav::killstreak::%attacker%}%&7.
    8.     you_died_with_a_killstreak: &7You died with a killstreak on &6%{rav::killstreak::%victim%}% kills&7.
    9.     player_now_has_a_killstreak: &e%attacker% &aNow has a killstreak of &6%{rav::killstreak::%attacker%}% kills.
    10.     number_between_killstreaks: 2
    11.  
    12. on join:
    13.     if {rav::killstreak2::%player%} is not set:
    14.         set {rav::killstreak2::%player%} to {@number_between_killstreaks}
    15.  
    16. on death of player:
    17.     if attacker is a player:
    18.         add 1 to {rav::killstreak::%attacker%}
    19.         send "{@prefix} {@you_killed_player}" to attacker
    20.         send "{@prefix} {@your_killstreak_after_kill}" to attacker
    21.     if {rav::killstreak::%victim%} is set:
    22.         send "{@prefix} {@you_died_with_a_killstreak}" to victim
    23.         delete  {rav::killstreak::%victim%}
    24.         delete {rav::kilstreakper5::%victim%}
    25.     if {rav::killstreak::%attacker%} is {rav::killstreak2::%attacker%}:
    26.         add {@number_between_killstreaks} to {rav::killstreak2::%attacker%}
    27.     if {rav::killstreak::%attacker%} is equal to 2:
    28.         broadcast "&6%attacker% &7now has a killstreak of &e%{rav::killstreak::%attacker%}%"
    29.     if {rav::killstreak::%attacker%} is equal to 4:
    30.         broadcast "&6%attacker% &7now has a killstreak of &e%{rav::killstreak::%attacker%}%"
    31.  
    32. command /killstreakreset [<player>]:
    33.     aliases: /ksr
    34.     trigger:
    35.         if arg-1 is not set:
    36.             send "&7Please give an username"
    37.         if arg-1 is set:
    38.             set {rav::killstreak::%arg-1%} to 0
    39.             set {rav::killstreakper5::%arg-1%} to 0
    40.             send "&6%arg-1%'s &7killstreak has been reset!"
    41. [CODE]
     
  2. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    307
    Likes Received:
    20
    Code (Text):
    1. on death:
    2.     if attacker is set:
    3.         loop {rav::killstreak::%attacker%} times:
    4.             if mod( loop-value, 5 ) is 0:
    5.                 # remainder is 0, so we should broadcast
    6.                 broadcast "%attacker% got a killstreak of %{rav::killstreak::%attacker%}%"
    7.  
    8. # pseudo code
    Something like this
     
  3. Moonl1ght

    Moonl1ght Member

    Joined:
    Aug 4, 2019
    Messages:
    6
    Likes Received:
    0
    Thank you very much!
     
    • Funny Funny x 1
Thread Status:
Not open for further replies.
Loading...