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

Crit animation inside script

Nokturno

Not a human
Joined
Aug 7, 2009
Messages
570
Solutions
2
Reaction score
403
sup ppl, dont know if someone cud give me a hand with this.
im trying to add a extra line of code to this, but dont manage to get it working.


Lua:
if Creature(variant:getNumber()):isPlayer() then
        local damage = math.floor((player:getEffectiveSkillLevel(SKILL_STRENGHT) * 0.01) + 1)
        player:addDamageCondition(Creature(variant:getNumber()), CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4)
        Creature(variant:getNumber()):sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)


this is the line that im adding
Lua:
 Creature(variant:getNumber()):sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)

it is the same with any const_me effect, im using 1.3 btw
 
sup ppl, dont know if someone cud give me a hand with this.
im trying to add a extra line of code to this, but dont manage to get it working.


Lua:
if Creature(variant:getNumber()):isPlayer() then
        local damage = math.floor((player:getEffectiveSkillLevel(SKILL_STRENGHT) * 0.01) + 1)
        player:addDamageCondition(Creature(variant:getNumber()), CONDITION_BLEEDING, DAMAGELIST_CONSTANT_PERIOD, damage, 1, 4)
        Creature(variant:getNumber()):sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)


this is the line that im adding
Lua:
 Creature(variant:getNumber()):sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)

it is the same with any const_me effect, im using 1.3 btw
You don't send magic effects to player you send them to position. Also a good idea to verify that creature exists first.
Lua:
local creature = Creature(variant:getNumber())
if creature then
    creature:getPosition():sendMagicEffect(CONST_ME_CRITICAL_DAMAGE)
end
 
Back
Top