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

msgcontains

Mauzim

Member
Joined
Jan 3, 2011
Messages
568
Reaction score
9
i have problem if i say to npc
example.
help
he reples to me
but if i msg
Help
he no reples to me
i think it's problem witch modules or npchander

example script for it is :
Code:
msgcontains(msg, 'help')
that is in all msg and npc ;p
Please help rep++
 
You can also edit the function in npc.lua
Lua:
function msgcontains(message, keyword) -- It's called doMessageCheck in newer distributions
	local message, keyword = message:lower(), keyword:lower()

	if type(keyword) == 'table' then
		return table.isStrIn(keyword, message)
	end

	return message:find(keyword) and not message:find('(%w+)' .. keyword) and not message:find(keyword .. '(%w+)')
end
but it's slower this way since it has to lower the strings on each call
 
ok next question why npc not say bye, or walkaway
Code:
        <parameter key="message_farewell" value="It was a pleasure to help you, |PLAYERNAME|."/>
		<parameter key="message_walkaway" value="Good bye." />

and how to make npc cant move to box etc.
 
Last edited:
ok next question why npc not say bye, or walkaway
Code:
        <parameter key="message_farewell" value="It was a pleasure to help you, |PLAYERNAME|."/>
		<parameter key="message_walkaway" value="Good bye." />

and how to make npc cant move to box etc.
It's a bug in sources...
not sure why won't they say bye though, try messing around with the npc system files
 
Back
Top