Hello.
If you check the first script, you will notice that it works like you want, except that it also checks if it's on screen, because it's not possible to know when a message is whisper, default or so... So people could easily record a .cam talking to you using uppercase and you would not notice.
Anyway, this will play sound and flash client if someone sends a message and it's uppercase or if it's a gm.
local SAFE_LIST = { 'player', 'player two' }
table.lower(SAFE_LIST)
local messages = getnewmessages()
local player_name = name()
for _, msg in ipairs(messages) do
if msg.sender ~= '' and msg.sender ~= player_name and table.find(SAFE_LIST, msg.sender:lower()) == nil then
local is_gm = false
local len_sender = msg.sender:len()
if len_sender >= 3 then
local str_sender = msg.sender:sub(0, 3)
if str_sender == 'GM ' or str_sender == 'CM ' then
is_gm = true
end
end
if len_sender >= 4 then
local str_sender = msg.sender:sub(0, 4)
if str_sender == 'GOD ' then
is_gm = true
end
end
if len_sender >= 6 then
local str_sender = msg.sender:sub(0, 6)
if str_sender == 'Admin ' then
is_gm = true
end
end
local upper_msg = msg.content:upper()
if is_gm or (msg.content == upper_msg then
playsound('alert_selectedchatmessage')
flashclient()
break
end
end
end