local soundst = require('moonloader').audiostream_state
local sampev = require 'lib.samp.events'
local soundURL = "https://zvukogram.com/mp3/73/dropped-a-bomb-and-it-exploded.mp3"
local sound = loadAudioStream(soundURL)
assert(sound, 'Cannot load sound from URL')
local triggers =
{
"слово1",
"слово2"
}
function main()
while not isSampAvailable() do wait(0) end
wait(-1)
end
function sampev.onServerMessage(color, text)
lua_thread.create(function()
local low = string.lower(text)
for _, word in ipairs(triggers) do
if low:match(word) then
setAudioStreamState(sound, soundst.PLAY)
break
end
end
end)
end