Jump to content

Effect apon spawning in skript


sulf

Recommended Posts

Hey all. 

I would like a skript that gives a player resistance 5 for the first 10 seconds after they respawn. 

HOWEVER if they hit someone, this effect will go away even if the time is not met. 

 

thanks in advance!

Edited by sulf
Added more info
Link to comment
Share on other sites

#-=-=-=-=-=-=-=-=-=-=-
#   Skript Made By:
#     S1LENT_EG
#-=-=-=-=-=-=-=-=-=-=-

on join:
    wait 1 ticks
    execute console command "/effect give %player% minecraft:resistance 10 5 true"
    set {%player%.pvp} to false
    
on respawn:
    wait 1 ticks
    execute console command "/effect give %player% minecraft:resistance 10 5 true"
    set {%player%.pvp} to false
    
on damage:
    if {%attacker%.pvp} is false:
        remove resistance from attacker
        set {%attacker%.pvp} to true

 

 

 

 

Hope this helps! (fixed)

Edited by __S1LENT__
  • Thanks 1

"The sun wont stop for no one"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...