Solved PvP respawn

  • 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.
How to make it, is it possible: ?

On respawn:
disable player pvp
Send title "PvP Cooldown" subtitle "5 seconds left"
wait 1 second
Send title "PvP Cooldown" subtitle "4 seconds left"
wait 1 second
Send title "PvP Cooldown" subtitle "3 seconds left"
wait 1 second
Send title "PvP Cooldown" subtitle "2 seconds left"
wait 1 second
Send title "PvP Cooldown" subtitle "1 seconds left"
wait 1 second
Send title "PvP Cooldown enabled"
enable player pvp

Or like this:
on respawn
send player title "&cPvP cooldown" with subtitle "&c&n5 seconds left"
set victim's invulnerability ticks to 100 #Victim will not take damage for the next second
wait 1 second
send player title "&cPvP cooldown" with subtitle "&c&n4 seconds left"
wait 1 second
send player title "&cPvP cooldown" with subtitle "&c&n3 seconds left"
wait 1 second
send player title "&cPvP cooldown" with subtitle "&c&n2 seconds left"
wait 1 second
send player title "&cPvP cooldown" with subtitle "&c&n1 second left"
wait 1 second
send player title "&aPvP on" with subtitle "&c&nDisabled cooldown"



what is the syntax for enabling and disabling pvp ?

Well i know skript is easy but its not that easy XD.

here u go:

Code:
#Delete all data on load
on script load:
    delete {PvpDelay::*}

#Remove data on relog
on quit:
    delete {PvpDelay::%uuid of player%}

#Check for damage
on damage:
    #Check if the attacker has a delay
    if {PvpDelay::%uuid of attacker%} is set:
        #Disable combat bc they are not allowed to hit people bc they are in delay
        send "U IN COOLDOWN" to attacker
        cancel event
        stop
    #Check if the victim has a delay
    if {PvpDelay::%uuid of victim%} is set:
        #Disable combat bc the victim is still in combat delay
        send "THAT PLAYER IS IN COOLDOWN" to attacker
        cancel event
        
#Respawn event
on respawn:
    #Set data to know wenn a player respawned
    set {PvpDelay::%uuid of player%} to player
    #Wait 5 times 1 second with a counting down title
    loop 5 times:
        Send title "PvP Cooldown" with subtitle "%6 - loop-number% seconds left"
        wait 1 second
    #Counter done
    Send title "PvP Cooldown enabled"
    #Delete Data
    delete {PvpDelay::%uuid of player%}
 
Not working:
upload_2020-5-2_14-49-19.png

[doublepost=1588868694,1588420167][/doublepost]
Not working:
upload_2020-5-2_14-49-19.png
+ BUMP
 
Status
Not open for further replies.