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

Lua Monster saying commands

Alcik

ots.tibiaserver.pl
Joined
Mar 12, 2009
Messages
177
Reaction score
4
Location
Ireland/Polish
Hey.

I am trying to make that monster all day, but finally, I decided to ask you for help.

I need a normal monster to say a command, !lol for example. The command deletes something from the map - it works for sure, but now, I need that monster to say it for me.
I tried to use a creaturescript.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="xxx" nameDescription="xxx" race="x" experience="x" speed="x" manacost="0">
	<health now="x" max="x"/>
	<look type="x" corpse="x"/>
	<targetchange interval="5000" chance="8"/>
	<strategy attack="100" defense="0"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="1"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
		<flag pushable="0"/>
		<flag canpushitems="1"/>
		<flag canpushcreatures="1"/>
		<flag targetdistance="1"/>
		<flag staticattack="90"/>
		<flag runonhealth="0"/>
	</flags>
	<script>
		<event name="saycommand"/>
	</script>
	<attacks>
		<attack name="melee" interval="2000" skill="42" attack="50"/>
		<attack name="manadrain" interval="2000" chance="13" range="1" min="-14" max="-23"/>
		<attack name="lifedrain" interval="2000" chance="15" range="7" target="1" min="-15" max="-24">
			<attribute key="areaEffect" value="redshimmer"/>
		</attack>
		<attack name="death" interval="2000" chance="10" range="7" target="1" min="-30" max="-49">
			<attribute key="shootEffect" value="death"/>
			<attribute key="areaEffect" value="mortarea"/>
		</attack>
	</attacks>
	<defenses armor="15" defense="10"/>
	<elements>
		<element firePercent="6"/>
	</elements>
	<immunities>
		<immunity lifedrain="1"/>
		<immunity paralyze="1"/>
	</immunities>
	<voices interval="1000" chance="10">
		<voice sentence="x."/>
		<voice sentence="x"/>
		<voice sentence="x"/>
		<voice sentence="x"/>
	</voices>
	<loot>
    <item id="2148" countmax="65" chance="28875" /><!-- gold coin -->
    <item id="2460" chance="11150" /><!-- brass helmet -->
    <item id="1987" chance="100000"><!-- bag -->
        <inside>
            <item id="9808" chance="7225" /><!-- rusty armor -->
        </inside>
    </item>
</loot>
</monster>
And this is what I added:
XML:
<script>
<event name="saycommand"/>
</script>

My saycommand script:
Lua:
function onThink(cid, interval)
	if(not isCreature(cid)) then
		return
	end
	else
doCreatureSay(cid, !lol, 1)
return true
end

My Error when I create this monster.:
Code:
Warning: [Monster::Monster]. Unknown event name - saycommand


So, I need this monster to say a text !lol randomly, every some time. For example, he will say !lol, and the after 2 sec he will say it again and the after another 5 sec he will say it once more and then after 3 sec and then after 1 sec, etc.
 
XML:
<event type="think" name="saycommand" event="script" value="saycommand.lua"/>
That's it.


@edit

BTW, I use TFS 0.2.10.
 
Last edited:
Back
Top