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
//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]
//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.
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)