• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

simple reflecta tfs 1.5 8.6

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, im tried make simple reflecta system, only for dmg dealed by monsters, and it working but i don't know why in console, i have erros "creature not found"? what's wrong with it?


Code:
local reflectaHealth = CreatureEvent("ReflectaHealthEvent")

function reflectaHealth.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    local amount = getPlayerReflecta(creature)
    if not attacker or not attacker:isPlayer() then
    doTargetCombatHealth(creature, attacker, primaryType, (primaryDamage * (amount*5)), (primaryDamage * (amount*5)))
else
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end

reflectaHealth:register()

1655854296222.png
 
Ok, i think it solved

Code:
    if not attacker and creature:isPlayer() then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end
 
Last edited:
Back
Top