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

Solved Monster attack me only when I attack it

The Crusher

New Member
Joined
Mar 15, 2013
Messages
10
Reaction score
0
I'm making a quest, but before it, I put a monster protecting it. My problem is that I don't want it to attack me when I get close to it.

This is the monster attacking me:
1.jpg

I need a script about a monster that only attack when I attack it, I've seen creaturescripts about "Passive Monsters", but no one works.

How I can make this script? :P
 
Last edited:
In monsters file set aggressive = 0

Where I put this?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Guardian Statue" nameDescription="a Guardian Statue" race="blood" experience="12000" speed="0">
  <health now="15000" max="15000"/>
  <look typeex="3739" corpse="0"/>
  <targetchange interval="2000" chance="50"/>
  <strategy attack="100" defense="70"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="0"/>
    <flag targetdistance="0"/>
    <flag staticattack="0"/>
    <flag runonhealth="0"/>
  </flags>
	<attacks>
		<attack name="melee" interval="2500" min="-220" max="-750"/>
			<attack name="physical" interval="1500" chance="1000" range="7" min="-220" max="-720">
			<attribute key="shootEffect" value="arrow"/>
    </attack>
	</attacks>
  <defenses armor="50" defense="120"/>
</monster>
 
Yeah it's hostile sorry I was on my phone xD forgot it was a diff name for monsters basically the same thing thanks Hansie
 
Oh okay then I believe it is aggressive try adding the aggressive="0" to the parameters

- - - Updated - - -

I will have some time today and I will test this

- - - Updated - - -

Alright I've looked into it, and the only way I'm finding to make this possible is to add a creaturescript to the monster, make 2 monsters exactly the same but set 1 not hostile, then when a player attacks it the creaturescript will delete that monster and create the hostile one, just set that one so that it doesn't change targets.. or something to that effect
 
http://otland.net/f481/xml-how-make-monster-fully-explained-104962/

As explained at the flag area.

flag hostile - this means that it will attack you if you see the monster, set to 0 if you want the monster to act like a rabbit

Conclusion: It is not possible

What I mean is how I make this:

Alright I've looked into it, and the only way I'm finding to make this possible is to add a creaturescript to the monster, make 2 monsters exactly the same but set 1 not hostile, then when a player attacks it the creaturescript will delete that monster and create the hostile one, just set that one so that it doesn't change targets.. or something to that effect

Creaturescript.
 
Code:
	if isMonster(cid) then
	if isPlayer(target) then
	if getPlayerStorageValue(target, 74564) ~= 1 then
	if getCreatureName(cid) == "Guardian Statuei" then
		return false
		
	end
	end
	end
	end

I just need a storage :)
 
Back
Top