#player damage

1 messages · Page 1 of 1 (latest)

unreal skiff
#

i coded a custom damage system but noticed a problem when trying to check for the on death event essentialy the damage system linked below damages the mob by damage victim by {_realdamage} and i noticed in testing that it isnt caught by the on death: event is there a way to fix this

#
    trigger:
        give player 1 iron sword named "&fsword of changing" with lore "&7level 1 required","","&cdamage &a20","&c&4fire damage &a20","","&eAbility launch" and "&7pushes the player forward"
        give player 1 bow named "&fbow of changing" with lore "&7level 1 required","","&cdamage &a20","&c&4fire damage &a20","","&eAbility launch" and "&7pushes the player forward"
on damage:
    if attacker is a player:
        set {_damage} to uncolored line 3 of lore of attacker's held item
        set {_edamage} to uncolored line 4 of lore of attacker's held item
        replace all "Damage","&c" and "&a" with "" in {_damage}
        replace all " " with "" in {_damage}
        replace all "air damage","fire damage","earth damage","water damage","&c&4" and "&a" with "" in {_edamage}
        replace all " " with "" in {_edamage}
        set {_damage} to "%{_damage}%" parsed as integer
        set {_edamage} to "%{_edamage}%" parsed as integer
        set {_realdamage} to ({_damage}+{_edamage})
        damage victim by {_realdamage}
        set {_health} to victim's health
        send "&2you damaged a %victim% by %{_realdamage}% victim has %{_health}% hp remaining" to attacker``` custom damge skript
#
    trigger:
        set {_levelrandom} to a random integer between 1 and 100    
        spawn zombie at player
        set {_z} to last spawned zombie
        set helmet of {_z} to diamond helmet
        set display name of {_z} to "hello level %{_levelrandom}%"
        set name of {_z} to "hello level %{_levelrandom}%"
        set artificial intelligence of {_z} to false
        set max health of {_z} to 999999
        heal {_z}
        
on death:
    if victim's display name contains "level":
        send "somthing died" to attacker``` on death event and mob
short jungle
#

try parsing it as an integer

#

not sure if it will work tho

graceful ridge
#

shouldn't you change damage victim by {_realdamage} to set damage to {_realdamage}

#

also don't parse as integer but number

#
set {_edamage} to "%{_edamage}%" parsed as integer```
graceful ridge
#

@unreal skiff

unreal skiff
#

yes

#

@graceful ridge sorry for the late response i have been without power till about 10m ago