@name Doorbell
@inputs 
@outputs 
@persist Player:entity
@trigger 
@model models/dav0r/buttons/switch.mdl

runOnTick(1)

if(first())
{
    timer("find",1000)    
}

if(clk("find")&findCanQuery())
{
    findByClass("player")
    Player = findClosest(entity():pos())
    timer("find",1000)
}

D = Player:pos():length() - entity():pos():length()

if(changed(Player:keyUse())&Player:keyUse()&D < 50&Player:aimEntity()==entity())
{
    entity():soundPlay(1,1,"/buttons/bell1.wav")  
    concmd("say Im coming!") 

}

