Kitpvp - Effect power up :)

Discussion in 'Skript' started by mbmaack_mbm, Aug 1, 2018.

  1. Hey, I tried to make a script when you kill a player you get a "Power up" you will get 1 more speed every time you kill one, but I can't make it and don't know how I can. I have tried but here is how long I come. Thx <3

    Code (Text):
    variables:
        {deaths.%player%} = 0
        {kills.%player%} = 0
        {Effect.%player%} = 0
     
    on death of player:
        loop all players:
            if attacker is a player:
                set {killst.%victim%} to 0
                add 1 to {killst.%attacker%}
                add 1 to {kills.%attacker%}
                add 1 to {Effect.%loop-player%}
            if victim is a player:
                set {killst.%victim%} to 0
                wait 1 ticks
                add 1 to {deaths.%victim%}
                wait 1 ticks
                strike lightning effect at the player
            if {killst.%attacker%} is 10:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 har en killstreak på &410 kills!"
            if {killst.%attacker%} is 15:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 har en killstreak på &415 kills!"
            if {killst.%attacker%} is 20:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 har en killstreak på &420 kills!"
            if {killst.%attacker%} is 30:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 har en killstreak på &430 kills!"
            if {killst.%attacker%} is 50:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 ER EN HACKER! &4(Killstreak på 50 kills!)"
            if {killst.%attacker%} is 70:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 ER MEGA GOD! &4(Killstreak på 70 kills!)"
            if {killst.%attacker%} is 85:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 ER MEGA GOD HACKER! &4(Killstreak på 85 kills!)"
            if {killst.%attacker%} is 100:
                broadcast "&3&lKitpvp &7> &b&l%attacker%&6 ER EKSTRA GOD HACKER! &4(Killstreak på 100 kills!)"
       
    on join:
        add 0 to {kills.%player%}
        add 0 to {deaths.%player%}
        add 0 to {hour::%player%}
        add 0 to {minute::%player%}
        add 0 to {second::%player%}
     
    every 1 second in "kitpvp":
        loop all players:
            if {Effect.%loop-player%} is 1:
                apply speed 1 to the loop-player for 60 seconds
                set {Effect.%player%} to 0
            if {Effect.%loop-player%} is 2:
                apply speed 2 to the loop-player for 60 seconds
                add 1 to {Effect.%loop-player%}
     
  2. Why do you loop all players on death? Also do you only want the speed to last for the first 60 seconds or do you want it to last until they die?
     
  3. Hey, I want it to last until they are dead :)
     
  4. All you need to do on death is clear the effects of the player via /effect %player% clear.
    The rest can be moved to on player kill or something.
     
  5. Sry, but can you make a code? So I know what you mean? :)
     
  6. I don't spoon feed but you can check the Skript docs here: https://docs.skunity.com/
     
  7. I don't think you understand what I want :) I don't want them to get clear from the effect I want to upgrade it? So speed 2 not one
     
  8. Since you are already using the every 1 second, then just make it so it clears their effects then adds whatever effect they should get depending on the kill streak (also I would suggest changing to to every 5 seconds instead of 1).
     
    • Like Like x 1
  9. Yes, I would say so it does not overwrite itself