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

Make monsters bc msg

Taurus

Texass
Joined
Jan 11, 2009
Messages
616
Solutions
2
Reaction score
30
Location
United States
<voices interval="5000" chance="10">
<voice sentence="THIS IS A WORK FREE DRUG PLACE!!" bc="true"/>
</voices>


I really thought this would work, can anyone think of something else? this is something i am dying to have.
 
You would have to make an onThink creaturescript that's only executed for monsters.

creaturescripts.xml
Code:
	<event type="think" name="MonsterBC" event="script" value="monsterbc.lua"/>
monsterbc.lua
Code:
local x = {}
function onThink(cid, interval)
	if not x[cid] then
		x[cid] = os.time() + 5
	elseif os.time() >= x[cid] then
		x[cid] = os.time() + 5
		if math.random(5) == 1 then
			doBroadcastMessage(getCreatureName(cid) .. ':\nTHIS IS A WORK FREE DRUG PLACE!!')
		end
	end
	return true
end
put this in the monster's .xml file:
Code:
	<script>
		<event name="MonsterBC"/>
	</script>
 
Last edited:
I see, and where can i post a request for such a thing? ur a sweetheart thanks btw

I understand these scripts, but have no idea how to like, start making one.

I do however REALLY like your scripts, where did you learn?


EDIT: OMG THANKS you know you're awesome dont u?

i wanna be like u when i grow up :p

Edit: Works like a charm, would it cause problems to run two of these scripts with diff names?
 
Last edited:
this script worked wonderfully, but it only bc when a player is there, is it possible to make one that only broadcasts the message if the monster is on the tile

like, a global event, that checks if the monster is there every 5 minutes, and bcs a msg if he is?

the only reason im even messing with all this is because in raids it summons a pile of monsters if no one kills them. is there a way yo make the raid run until the monster is killed? i tried both examples in raids.xml.
 
Back
Top