Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name danger sensor
- @inputs
- @outputs
- @persist A:entity Sound Doors:array Trig
- @trigger
- interval(1000)
- if(owner():keyUse()){
- Trig = 0
- for(Door=1,Doors:count()){
- if(Doors[Door,entity] == owner():aimEntity()){Doors:remove(Door) Trig = 1 print(owner():aimEntity():toString()+ " removed")}
- }
- if(Trig == 0){Doors:pushEntity(owner():aimEntity()) print(owner():aimEntity():toString() + " added")}
- }
- for(Door=1,Doors:count()){
- findInSphere(Doors[Door,entity]:pos(),100)
- findIncludeClass("player")
- A = findClosest(entity():pos())
- if(Sound == 0){
- if(A:weapon():type() == "lockpick"){Sound = 10
- print("----------------------------------")
- print("WARNING LOCKPICK DETECTED")
- print("----------------------------------")
- }
- if(A:weapon():type() == "keypad_cracker"){Sound = 10
- print("----------------------------------")
- print("WARNING KEYPAD CRACKER DETECTED")
- print("----------------------------------")
- }
- if(A:weapon():type() == "door_ram"){Sound = 10
- print("----------------------------------")
- print("WARNING DOOR RAM DETECTED")
- print("----------------------------------")
- }
- }
- if(Sound == 10){
- owner():soundPlay(1,0,"npc_barney.ba_danger02")
- }
- if(Sound!=0){Sound--}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement