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!

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

Please help me fix this skript, I have been trying for hours

Discussion in 'Requests' started by gamerguy987, May 22, 2021.

Tags:
  1. gamerguy987

    gamerguy987 Member

    Joined:
    May 22, 2021
    Messages:
    1
    Likes Received:
    0
    Ok, so im making a skript based on the 3rd life smp and im having problems making a player on their last life be able to start pvp, so a player on their life 1 should be able to start pvp and other players on any life should be able to attack back for 20 seconds,but someone on their 2 and 3 life should not be able to start pvp.

    This is what i have now: (This is only the damage section that i need help with)

    on damage:
    victim is player
    attacker is player
    if {lives.%attacker%} is 1:
    set {can attack.%victim%} to yes
    if {can attack.%victim%} is no:
    cancel event
    if {can attack.%victim%} is yes:
    set {can attack.%victim%} to yes
    wait 20 seconds
    set {can attack.%victim%} to no

    In this case someone on their life 1 can attack but people on their 2 and 3 life can't attack back, How do i fix this?
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    It's a very bad solution but try that
    Code (Text):
    1. on damage of player:
    2.   if attacker is player:
    3.     if {lives::%attacker%} is 1:
    4.       set {can attack::%victim%} to true
    5.     if {canattack::%victim%} is false:
    6.       cancel event
    7.     if {canattack::%victim%} is true:
    8.       set {canattack::%victim%} to true
    9.       wait 20 seconds
    10.       set {canattack::%victim%} to false
     

Share This Page

Loading...