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

Lua [tfs 1x+] reflect

theduck

Member
Joined
Dec 6, 2018
Messages
246
Reaction score
20
when the player attacks monster X with any type of attack, the damage received by that monster will go to monster Y
 
Last edited:
Solution
no error on the console just does not work
try with prints.

Lua:
local effects = {
    [COMBAT_PHYSICALDAMAGE] = CONST_ME_DRAWBLOOD,
    [COMBAT_ENERGYDAMAGE] = CONST_ME_ENERGYAREA,
    [COMBAT_EARTHDAMAGE] = CONST_ME_POISONAREA,
    [COMBAT_FIREDAMAGE] = CONST_ME_FIREAREA,
    [COMBAT_ICEDAMAGE] = CONST_ME_ICEAREA,
    [COMBAT_HOLYDAMAGE] = CONST_ME_HOLYAREA,
    [COMBAT_DEATHDAMAGE] = CONST_ME_MORTAREA,
    [COMBAT_HEALING] = CONST_ME_MAGIC_GREEN
}

function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    print(1)
    print(creature:getName():lower())
    if Monster(creature) and creature:getName():lower() == "rat" then
        print(2)
        print(primaryType)
        if primaryType ~= COMBAT_HEALING then
            print(3)
            print(special.creatures.boss.cave_rat[1])...
I don't think I can solve this over OtLand
I pm'd you contact details if you want to continue over discord.
I added you.

-
I was thinking it is not possible to create getSpectators
so that when monster 1 suffers an attack it copies its life to monster 2
 
Back
Top Bottom