Chat sound script ( Say a certain thing in chat to trigger a sound)

I would very much appreciate if someone could make a script for me where if you type a certain thing in the chat like “no” it would play a certain sound. And if it wasn’t to much of a hassle make it “noob” friendly, pretty much like a customizable script

IE: add little note’s directing whoever is looking at the file how to do things

EX: You can make extra classes here. Set everything up here and the rest will be done for you! no more editing 100 files without knowing what you’re doing!!!
Ok here’s how:

To make an extra class do this:
AddExtraTeam( “<NAME OF THE CLASS>”, Color(<red>, <Green>, <blue>, 255), “<Player model>” , [[<the description(it can have enters)>]], { “<first extra weapon>”,"<second extra weapon>", etc…

That example is from a the shared file in DarkRP gamemode folder.

So please any lua scripter out there, I would love you if you made this script

I’ll make this, give me a little bit.

EDIT:

Finished, here you go.

[lua]
ChatSounds = {}

//Function for adding chat sounds.
function AddChatSound(word,sound)
ChatSounds[word] = sound
end

//Whenever a player says something this is called.
function PlayChatSound(pl,text,team,death)
for k,v in pairs(ChatSounds) do
if string.find(string.lower(text),string.lower(k)) then
PlaySoundAll(v)
break
end
end
end
hook.Add(“PlayerSay”,“PlayChatSound”,PlayChatSound)

//Plays the sound for everyone.
function PlaySoundAll(sound)
for k,v in pairs(player.GetAll()) do
surface.PlaySound(sound)
end
end

//Example:
AddChatSound(“hello”,“sound/gta/car_honk.wav”)
//So, when the player types “Hello” or “hello” it will play that sound for everyone.
[/lua]

omfg i love you!

buut its not working heres what i did.

ChatSounds = {}

//Function for adding chat sounds.
function AddChatSound(word,sound)
ChatSounds[word] = sound
end

//Whenever a player says something this is called.
function PlayChatSound(pl,text,team,death)
for k,v in pairs(ChatSounds) do
if string.find(string.lower(text),string.lower(k)) then
PlaySoundAll(v)
break
end
end
end
hook.Add(“PlayerSay”,“PlayChatSound”,PlayChatSound )

//Plays the sound for everyone.
function PlaySoundAll(sound)
for k,v in pairs(player.GetAll()) do
surface.PlaySound(sound)
end
end

//Example:
AddChatSound(“hello”,“sound/gta/car_honk.wav”)
//So, when the player types “Hello” or “hello” it will play that sound for everyone.

AddChatSound(“bye”,“vo/coast/cardock/le_bye.wav”)

AddChatSound(“incoming”,“vo/canals/female01/stn6_incoming.wav”)

AddChatSound(“yes”,“vo/Citadel/al_yes.wav”)

AddChatSound(“shit”,“vo/Citadel/br_ohshit.wav”)

AddChatSound("ns,"vo/eli_lab/al_niceshot.wav)

AddChatSound(“god”,“vvo/npc/Alyx/ohgod01.wav”)

AddChatSound(“finally”,“vo/npc/female01/finally.wav”)

AddChatSound(“hacks”,“vo/npc/male01/hacks02.wav”)

AddChatSound(“lol”,“vo/ravenholm/madlaugh04.wav”)

EDIT: i also put it in my lua/autorun folder of my server

lua/autorun/server



local chatsounds = {}

chatsounds["lol"] = "vo/Citadel/br_laugh01.wav"
chatsounds["rofl"] = "vo/ravenholm/madlaugh03.wav"
chatsounds["lmao"] = "vo/ravenholm/madlaugh03.wav"	
chatsounds["gtfo"] = "vo/npc/male01/gethellout.wav"	
chatsounds["hello"] = "vo/npc/male01/hi02.wav"
chatsounds["oh shit"] = "vo/npc/Barney/ba_ohshit03.wav"
chatsounds["omg"] = "vo/NovaProspekt/al_ohmygod.wav"
chatsounds["fuck you"] = "vo/Streetwar/rubble/ba_tellbreen.wav"
chatsounds["eek"] = "ambient/voices/f_scream1.wav"
chatsounds["oh yeah"] = "vo/npc/Barney/ba_ohyeah.wav"
chatsounds["rise and shine"] = "vo/gman_misc/gman_riseshine.wav"
chatsounds["hacks"] = "vo/npc/male01/hacks01.wav"
chatsounds["oh no"] = "vo/npc/male01/ohno.wav"	


function ChatSounds( ply, text )

	for k, v in pairs( chatsounds ) do
	
		if string.find( string.lower( text ), k ) then
		
			ply:EmitSound( v )
			
		end
		
	end
	
end
	
hook.Add("PlayerSay", "ChatSounds", ChatSounds)


No, that would be terrible.