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

100% protection spell

Edroniasty

New Member
Joined
Oct 2, 2015
Messages
84
Reaction score
1
Hello, looking for 100% protection spell from elements like physical,fire etc.. working for 10 seconds then stop, someone have spell like this foron tfs 1.2+?

bump
 
Last edited by a moderator:
Solution
You can try something like this(not tested).

Creaturescript(don't forget to also register it in login.lua)
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)

    if primaryType == COMBAT_HEALING or secondaryType == COMBAT_HEALING then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end
  
    if creature and creature:isPlayer() then
            if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 56) then
                creature:getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY)
                primaryDamage = 0
                secondaryDamage = 0
            end
    end
return primaryDamage, primaryType, secondaryDamage...
You would need to create an onManaChange function as well
I tried using the same script, but with onManaChange but I still can't get it to work.. What am I doing wrong?

EDIT: I had to restart the server to get it to work. Will update if it stops working!
(I just copied the old file and changed onHealthChange to onManaChange in a new file)
 
Last edited:
Back
Top