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

[RaceWar]Working monsters do not attack certain players. (bugged)

fatelord

New Member
Joined
Aug 7, 2007
Messages
56
Reaction score
1
Hello!
I'm trying to do a RaceWar System (Will be posted when its fully functional) but ive got the following problem:
I want some monster to ignore certain players, due to its sex. In the test i've done the following:
Creatureevents.xml
PHP:
<event type="combat" name="Racewar2" event="script" value="racewar2.lua"/>
Racewar2.lua
PHP:
local config = {
racewars = 1, -- 1 = ON/ any other number = OFF

}
function onCombat(cid, target)
        if isPlayer(target) ~= TRUE then
                return TRUE
        end

        if config. racewars == 1 then -- if NORMAL
                if getPlayerSex(target) == 1 then
                        doMonsterSetTarget(cid, [B]null[/B])
                        return FALSE
                end
        else
        
        return TRUE
end 
end
login.lua (Dunno if i really need to set here, since its a monster only condition)
PHP:
registerCreatureEvent(cid, "Racewar2")
and on the monster i've tested, in case Orc.xml, after the <flags> and before the <attacks>
PHP:
<script>
<event name="Racewar2"/>
</script>

What happens? Bom! The monster does not attack the player! Exactly what I want, but it follows the player :/ I wanted them to ignore the players and just walk around, like when invisible players walk by.

To that null i've also tested 0, but no idea actually.

Anyone please
 
it would be awesome.. like being protected by a orc warlord, but it just doesnt change target :p
Ty for reply anyways.. I dont feel ignored anymore xD
 
Back
Top Bottom