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

Looking for talking scripts

Exectric

New Member
Joined
Jun 6, 2007
Messages
25
Reaction score
0
XML 8.1 needed.
What I want is a script that makes an item say 10 different things, but there's a 10% chance that it will say any of things that it will say.
 
Yeah i know, dont 10% chance to blablablaba....
Random say ! :)

PHP:
local SOUNDS = {"TEXT 1", "TEXT 2", "TEXT 3", "TEXT 4", "TEXT 5", "TEXT 6", "TEXT 7", "TEXT 8", "TEXT 9", "TEXT 10"}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local random = math.random(1, table.maxn(SOUNDS))
	if(fromPosition.x ~= CONTAINER_POSITION) then
		doCreatureSay(cid, SOUNDS[random], TALKTYPE_MONSTER, false, 0, fromPosition)
	else
		doCreatureSay(cid, SOUNDS[random], TALKTYPE_MONSTER)
	end

	return true
end
 
Back
Top