Yes this is totally possible using an if activated check. This allows you to do most of the work within the editor itself by adding the name of the entity to target under "IfUsed" in the properties.
We already have the switch Lua there for you in stock.
The alarm script however you would have to make yourself... it would look something like this:
local alarm_on = {}
function alarm_init(e)
alarm_on[e] = 0
LoopSound(e,0)
end
function alarm_main(e)
if g_Entity[e]['activated'] == 1 then
if alarm_on[e] == 0 then
LoopSound(e,0)
alarm_on[e] = 1
elseif alarm_on[e] == 1 then
StopSound(e,0)
alarm_on[e] = 0
end
SetActivated(e,0)
end
end
Not sure if that works, but that's basically the jist of it.
Store Assets -
Store Link
Free Assets -
Resource Link
i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960