All pastes #264070 Raw Edit

Something

public text v1 · immutable
·published 2006-12-02 01:15 UTC
rendered paste body
function ReadList(str)
foundstr = nil

	for i=1,table.getn(SoundTable) do
		
		if string.Find(i,str) then
		foundstr = pl
		end
	end
return foundstr end


SoundTable = { 
"englich" = "vo/npc/male01/vanswer01.wav",
"bs" = "vo/npc/male01/question26.wav"}

if (SERVER) then

function PlayerSounds( pl, text )

local fSound = ReadList(text)

	if fSound ~= nil then

	pl:EmitSound(fSound)
	
	end
end

hook.Add( "PlayerSay", "psounds", PlayerSounds );