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

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

Idiosyncratic

Member
Feb 21, 2017
62
0
0
20
USA
I've been trying to make lore damage, (Damage based on an item's lore) but It doesn't work. The skript loads without error but the damage does not occur in-game.

code_language.skript:
on damage:
 attacker is holding a sword
 1 of sword's lore is "&7Damage: &r255"
 set damage to 127.5

P.S.
I am aware that I would have to make lore damage for every possible weapon damage in my server with this method, if anyone knows if it is possible to make a work-around I would greatly appreciate to know.
 
Maybe make it instead of "Set damage to 127.5" to "Cancel event" after that line "Damage Victim for 127.5 hearts"
Its in that way, but have no access to computer atm sorry.
 
I've been trying to make lore damage, (Damage based on an item's lore) but It doesn't work. The skript loads without error but the damage does not occur in-game.

code_language.skript:
on damage:
 attacker is holding a sword
 1 of sword's lore is "&7Damage: &r255"
 set damage to 127.5

P.S.
I am aware that I would have to make lore damage for every possible weapon damage in my server with this method, if anyone knows if it is possible to make a work-around I would greatly appreciate to know.

code_language.skript:
on damage:
    attacker is a player
    if attacker's tool is a sword:
        if lore of attacker's tool is "&7Damage: &r255":
            set damage to 127.5
 
@NoobMazter If I do it like that I can't use my custom combat system that I have coded that relies on the damage being dealt by the sword itself.
@YoshYz Just attempted to use that but it had the same effect.

Side note: I forgot to mention that I will be making other stats as well, will I need to code something to prevent these stats from countering out each other?
 
@NoobMazter If I do it like that I can't use my custom combat system that I have coded that relies on the damage being dealt by the sword itself.
@YoshYz Just attempted to use that but it had the same effect.

Side note: I forgot to mention that I will be making other stats as well, will I need to code something to prevent these stats from countering out each other?

Try
1)
code_language.skript:
cancel the event
damage victim by 127.5
2)
code_language.skript:
cancel the event
set {_damage} to damage
set {_damage} to 127.5-{_damage}
damage victim by {_damage}
 
You can just do
Yeah, not even for one hit.

You can just do
code_language.skript:
on damage:
    attacker is a player
    victim is a player
    set {lasthit.%victim%} to "%attacker%"
    
on death of player:
    if {lasthit.%player%} is set:
        set death message to ""
        broadcast "&c%player% &7was killed by &a%{lashit.%player%}%&7."
 
Oh no, I still want the damage stat, but the damage needs to be dealt by the player, not by skript, sorry for the miscommunication.
 
Oh no, I still want the damage stat, but the damage needs to be dealt by the player, not by skript, sorry for the miscommunication.

Oh , now i understand. So , if the set damage to you doesn't work , i don't know how to help you for that.
Have you already tried to put an integer below 100?
 
Yeah, it had the same effect.
[doublepost=1490204399,1490197580][/doublepost]Would I be able to use variables or something to make it a wide range of numbers that could give that amount of damage?

code_language.skript:
on damage:
 lore of attacker's tool is "&7Damage: &r255"
 set damage to 127.5

I tried this but when I attack I get this error:
error.PNG
 
Last edited by a moderator:
Status
Not open for further replies.