TibianusIII
New Member
- Joined
- Jan 22, 2010
- Messages
- 6
- Reaction score
- 0
Wazzup guyz, so like the title says... how can i do a monster that just attack if get attacked? i have to edit the source code? how i do it?
function onAttack(cid, target)
if isPlayer(cid) and isMonster(target) then
doMonsterSetTarget(target, cid)
elseif isMonster(cid) and isPlayer(target) then
return false
end
return true
end
<script>
<event name="creatureEventName" />
</script>
easy to make,
OnAttack function.
I'd like too see you do the script, because I'm pretty sure no script will work here unless you change in source.
And how i change in source? with what progams? i've never did this before..
function onAttack(cid, target)
if isPlayer(cid) and isMonster(target) then
[COLOR="#FF0000"][B]local name = getCreatureName(target)
local pos = getCreaturePosition(target)
doRemoveCreature(target)
doCreateMonster(pos ''..name..'1') -- You will of course need an another mosnter who just isn't flagged passive. Like Dragon (passive) and Dragon1 which is not passive. Name can stay the same, just the monsters.xml config name counts.[/B][/COLOR]
elseif isMonster(cid) and isPlayer(target) then
return false
end
return true
end