Breaching Doors?

Hey there, does anybody know how to make it with weapons so that when you shoot a door with them it blows the door off the hinges and such and it respawns sometime after?

The shotgun from “MAD COW WEAPONS” did this. Using google, you should be able to find it, weather it works with gmod 13 or not, is another question.

This is pretty old and I couldn’t test it, used to work fine though.

[lua] local tr = util.TraceLine( trace );

	if( SERVER and tr.Entity:IsValid() and ( tr.Entity:GetClass() == "prop_door_rotating" or tr.Entity:GetClass() == "func_door_rotating" ) ) then
	
		tr.Entity:Fire( "Unlock" );
		self.Owner:ConCommand( "+use

" );
timer.Simple( .1, self.Owner.ConCommand, self.Owner, "-use
" );

	end

	if( tr.Entity:IsValid() and tr.Entity:GetClass() == "prop_door_rotating" ) then
		
		if( true ) then
		
			tr.Entity:EmitSound( Sound(  "physics/wood/wood_box_impact_hard3.wav" ) );
			
			if( SERVER ) then
				
				local pos = tr.Entity:GetPos();
				local ang = tr.Entity:GetAngles();
				local model = tr.Entity:GetModel();
				local skin = tr.Entity:GetSkin();
				
				tr.Entity:SetNotSolid( true );
				tr.Entity:SetNoDraw( true );
				
				if( tr.Entity.Lock ) then
					
					tr.Entity.Lock:Remove();
					
				end
				
				local function ResetDoor( door, fakedoor )
					door:SetNotSolid( false );
					door:SetNoDraw( false );
					fakedoor:Remove();
				end
				
				local norm = ( pos - self.Owner:GetPos() ):Normalize();
				local push = 10000 * norm;


				local ent = ents.Create( "prop_physics" );
				ent:SetPos( pos );
				ent:SetAngles( ang );
				ent:SetModel( model );
				if( skin ) then
					ent:SetSkin( skin );
				end
				ent:Spawn();
				
				timer.Simple( .2, ent.SetVelocity, ent, push );					
				timer.Simple( .2, ent:GetPhysicsObject().ApplyForceCenter, ent:GetPhysicsObject(), push );
				
				timer.Simple( 300, ResetDoor, tr.Entity, ent );
				
			end

		end
	
	end

[/lua]

MIGHT BUMP… xD Thx man :3


(User was banned for this post ("dumb bump" - Orkel))