• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Making NPCs yelling something.

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hello.

I have onThink thingy that makes npc saying text on random.

Code:
function onThink()
talk = math.random(1,100)
	if talk == 1 then
		selfSay("Best wands and rods in city!")
	end
if talk == 2 then
		selfSay("Cheapest magic equipment here!")
	end
end

But how to make that NPC yells this text?

Thanks,
Hermes
 
Hello.

I have onThink thingy that makes npc saying text on random.

Code:
function onThink()
talk = math.random(1,100)
	if talk == 1 then
		selfSay("Best wands and rods in city!")
	end
if talk == 2 then
		selfSay("Cheapest magic equipment here!")
	end
end

But how to make that NPC yells this text?

Thanks,
Hermes

Its there no like auto_talk na but something you knwo ;)
 
Code:
function onThink()
talk = math.random(1,100)
	if talk == 1 then
		doCreatureSay(getNpcCid(), "Best wands and rods in city!", TALKTYPE_YELL)
	end
if talk == 2 then
		doCreatureSay(getNpcCid(), "Cheapest magic equipment here!", TALKTYPE_YELL)
	end
end
You can ofcourse make whatever you want with chance of yelling. For example:
Code:
if talk < 50 then
or
Code:
talk = math.random(1,10)
 
Use it like this:
Code:
function thinkCallback()
	--Your code here
	return true
end

and above:
Code:
npcHandler:addModule(FocusModule:new())

add:
Code:
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
 
Back
Top