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

What is wrong?

tuppan

New Member
Joined
Jun 27, 2008
Messages
43
Reaction score
2
by :Nahruto

PHP:
  function onStatsChange(cid, attacker, type, combat, value)
    if (type == STATSCHANGE_HEALTHLOSS) then
        local master = getCreatureMaster(cid)
        if (master ~= cid) then --is summon check
            if isInArray({master, cid}, attacker) then
                return false
            end
        end
    end
    return true
end

he make to me this script! but doest work! is supossed to make my fir elemental dont attack me with fire area! :(
 
its should be ...

Code:
i've add this in fire elemental.xml
PHP:
<script>
<event name="Summon" />
</script>
</monster>

Code:
i've add this in creaturesevents.xml


PHP:
<event type="StatsChange" name="summon" event="script" value="summon.lua"/>


is right?:confused:

13:02 Your Fire Elemental deals 81 damage to a target. :S
 
LUA:
function onCombat(cid, target)
    if isMonster(cid) then
        local master = getCreatureMaster(cid)
        if (cid ~= master) and isInArray({master, cid}, target) then
            return false
        end
    end
    return true
end

worked for me
 
Back
Top