Here is yet another code im releasing. You spawn an E2 chip (with the code in it) on a vehicle, then wire output:detonate to a wire explosive. It is setup so when you say "!arm" it is armed, and "!disarm" disarms it. when its armed, if any player enters the vehicle, it is ready. It detonates once that player leaves the vehicle.
I actually made this about a week ago:
Code:@name Automobile Bomb @outputs Detonate @persist [Driver]:entity [Armed Detonate Ready] if(first()|duped()) { runOnChat(1) hint("Made by Jasongamer1",5) if(!(toString(entity():isWeldedTo()):find("Vehicle")) & changed(toString(entity():isWeldedTo()))) { hint("ERROR: Chip must be spawned somewhere on a vehicle.",5) entity():setColor(vec(255,0,0)) selfDestruct() } else { Vehicle=entity():isWeldedTo() Detonate=0 Ready=0 hint("Say !Arm to arm the bomb, and !Disarm to disarm it.",10) hint("Make sure that you wire the bomb up to an explosive!",10) holoCreate(1000,entity():pos(),vec(0.24,0.24,0.24),entity():angles()) holoParent(1000,entity()) holoModel(1000,"hqicosphere2") holoColor(1000,vec(0,0,0)) } } if(Vehicle!=noentity()) { if(chatClk(owner())) { if(owner():lastSaid():lower():sub(0,1)=="-") { hideChat(1) if(owner():lastSaid():lower():explode(" ")[1,string] == "-arm") {Armed=1, hint("Car bomb is now armed",10), Ready=0} if(owner():lastSaid():lower():explode(" ")[1,string] == "-disarm") {Armed=0, hint("Car bomb is now disarmed",10), Ready=0} } else{hideChat(0)} } if(Armed) { interval(200) if(Armed&$Armed){holoColor(1000, vec(255,255,0))} if(Vehicle:driver()&changed(Vehicle:driver())) { interval(20) Driver = Vehicle:driver() hint("Driver in vehicle, ready to detonate when driver leaves vehicle!",20) Ready=1 } if(Ready & Driver:health()>0) { holoColor(1000, vec(255,0,0)) if(Driver==noentity() & changed(Driver)) { hint("Driver left vehicle, Detonating now!",8) Detonate = 1 Ready = 0 Detonate = 0 } } } elseif(!Armed) { if(!Armed&$Armed) { holoColor(1000, vec(0,0,0)) } interval(0) } }


LinkBack URL
About LinkBacks




Reply With Quote




Bookmarks