Hi. I want to get chat sounds in my own gmod server.Then i found this topic and code here
USay = {}
USay.WordList = {
["hi"] = "sound/hi.wav";
}
function USay.ChatFunction( ply, text )
if ply:IsValid() then
for k,v in pairs(USay.WordList) do
if string.find( text, k ) then
game.ConsoleCommand("ulx playsound " ..USay.WordList[k].. "\n")
return text
end
end
end
end
hook.Add("PlayerSay", "USay.ChatFunction_Hook", USay.ChatFunction)
https://forums.ulyssesmod.net/index.php?topic=3762.0I installed correctly but some sounds won't be played correctly. For example when I type "apple", somehow "a.mp3" be played even if "apple.mp3" exists.
I wrote "usay.lua" correctly. I guess the script doing this. But I have no idea to solve this...
Someone help me please.
Thank you and sorry for my broken english