Solved Enderpearl damage

  • 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!

iCritiqing

Member
Jul 4, 2017
13
0
1
21
Category: misc

Suggested name: EpDamage

What I want:
I want a skript that can disable/reduce player's enderpearl damage...
and the reduced damage is corresponding to the given ammoun

Example:
An admin type /ep 50 iCritiqing
then the player iCritiqing will only take 50% of the full enderpearl damage

An admin type /ep 100 iCritiqing
the player iCritiqing won't take any damage from enderpearls


Ideas for commands:
/ep 25 [Name]
/ep 50 [Name]
/ep 75 [Name]
/ep 100 [Name]

Ideas for permissions:
ep.admin > To type the /ep command

When I'd like it by: A reasonable time
 
Category: misc

Suggested name: EpDamage

What I want:
I want a skript that can disable/reduce player's enderpearl damage...
and the reduced damage is corresponding to the given ammoun

Example:
An admin type /ep 50 iCritiqing
then the player iCritiqing will only take 50% of the full enderpearl damage

An admin type /ep 100 iCritiqing
the player iCritiqing won't take any damage from enderpearls


Ideas for commands:
/ep 25 [Name]
/ep 50 [Name]
/ep 75 [Name]
/ep 100 [Name]

Ideas for permissions:
ep.admin > To type the /ep command

When I'd like it by: A reasonable time

a bit late but it works (for me).

code_language.skript:
command /ep <integer=0> <player>:
    trigger:
        if arg 1 >= 0:
            if arg 1 <= 100:
                set {ep.reduction::%uuid of arg 2%} to arg 1
                
on damage:
    if damage cause is fall:
        cancel event
        wait 1 tick
        if {enderpearl::%uuid of victim%} is set:
            set {_calc} to {ep.reduction::%uuid of victim%}
            if {ep.reduction::%uuid of victim%} is not set:
                set {_calc} to 0
            set {_dam} to damage / 100
            set {_dam} to {_dam} * {_calc}
            set {_dam} to damage - {_dam}
            damage victim by {_dam}
        else:
            damage victim by damage

on script load:
    delete {enderpearl::*}

on projectile hit:
    if event-entity is a ender pearl:   
        set {enderpearl::%uuid of shooter%} to true
        wait 1 tick
        delete {enderpearl::%uuid of shooter%}
 
a bit late but it works (for me).

code_language.skript:
command /ep <integer=0> <player>:
    trigger:
        if arg 1 >= 0:
            if arg 1 <= 100:
                set {ep.reduction::%uuid of arg 2%} to arg 1
              
on damage:
    if damage cause is fall:
        cancel event
        wait 1 tick
        if {enderpearl::%uuid of victim%} is set:
            set {_calc} to {ep.reduction::%uuid of victim%}
            if {ep.reduction::%uuid of victim%} is not set:
                set {_calc} to 0
            set {_dam} to damage / 100
            set {_dam} to {_dam} * {_calc}
            set {_dam} to damage - {_dam}
            damage victim by {_dam}
        else:
            damage victim by damage

on script load:
    delete {enderpearl::*}

on projectile hit:
    if event-entity is a ender pearl: 
        set {enderpearl::%uuid of shooter%} to true
        wait 1 tick
        delete {enderpearl::%uuid of shooter%}
Thanks Bro :emoji_grinning:
It works nicely
but i improoved it a bit tho, and by the way you forgot the permissions thinggy :emoji_grinning:

Here's my edit
code_language.skript:
options:
    Prefix: &c&lSoul&fStars &7&l>>
    Maincolor: &6
    Secondcolor: &7
    Red: &c

command /ep <integer=0> <player>:
    permission: ep.admin
    trigger:
        if arg 2 is not set:
            message "{@Prefix} {@Maincolor}Usage /ep <integer> <name>"
        else:
            if arg 1 >= 0:
                if arg 1 <= 100:
                    set {ep.reduction::%uuid of arg 2%} to arg 1
                    message "{@Prefix} {@Secondcolor}%arg 2%'s {@Maincolor}enderpearl damage has been reduced by {@Red}%arg 1% {@Maincolor}percent"
                    message "{@Prefix} {@Maincolor}Your enderpearl damage has been reduced by {@Red}%arg 1% {@Maincolor}percent" to arg 2
                if arg 1 > 100:
                    message "{@Prefix} {@Red}ERROR! Enderpearl damage reduction values must be bigger than -1 and smaller than 101!"
             
on damage:
    if damage cause is fall:
        cancel event
        wait 0.005 tick
        if {enderpearl::%uuid of victim%} is set:
            set {_calc} to {ep.reduction::%uuid of victim%}
            if {ep.reduction::%uuid of victim%} is not set:
                set {_calc} to 0
            set {_dam} to damage / 100
            set {_dam} to {_dam} * {_calc}
            set {_dam} to damage - {_dam}
            damage victim by {_dam}
        else:
            damage victim by damage

on script load:
    delete {enderpearl::*}
 
on projectile hit:
    if event-entity is a ender pearl:
        set {enderpearl::%uuid of shooter%} to true  
        wait 0.005 tick
        delete {enderpearl::%uuid of shooter%}
       
       
#Originaly created by: Lego_freak1999
#Edited by: iCritiqing
 
Last edited: