• 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 [OTX-TFS 1.2]

michiz

New Member
Joined
May 18, 2013
Messages
2
Reaction score
1
Hey guys,

I trying to make this work. Can someone help me?

creaturescripts.xml
XML:
<event type="healthchange" name="crit" script="crit.lua" />

crit.lua

Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    attacker:sendTextMessage(MESSAGE_EVENT_ORANGE, "Attacker: " .. attacker:getName() .. "\n")
    attacker:sendTextMessage(MESSAGE_EVENT_ORANGE, "Victim: " .. creature:getName() .. "\n")

    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

login.lua
Lua:
  player:registerEvent("crit")

There is no any errors in console and still is no work.
 
Back
Top