Super simple raid detector?
I am a total newb in coding gmod(lua) but i do have coding background with java and c++, so im not a newb to programming, i understand loops and if statements and all so the coding lingo im fine with.
Basically what im trying to do is, when you run this script it will search in the chat for the word "raid" and when it finds it, it will play a sound and input in your chat box (chat.AddText) that someone has called raid. Therefore you can check your front door or whatever to see if that raid is on you.
Heres my code so far (im a newb please dont flip out on me, however constructive criticism is appreciated)
If you have a better/ more efficient way or better idea please do tell
chat.AddText( Color( 0, 180, 180 ), "[Raid Buddy] ", Color( 255, 255, 255 ), "You've Enabled Raid Buddy!")
if (chat.Text == "raid" || "Raid" || "RAID") then
chat.AddText( Color( 0, 180, 180 ), "[Raid Buddy] ", Color( 255, 255, 255 ), "Someone Called Raid in Chat!" )
chat.PlaySound()
end
Its not much code, i just started and i couldnt figure out how i should go about scanning the chat. I was also thinking maybe i would need a while loop so it would continue scanning until it finds the word raid?
Please help