I've tried using explosions within walls, this works but is horribly laggy and can result in

so I would like to know what the best way for doing this is!
thanks!
Scripts
Damaging a wall by a custom amount.
Damaging a wall by a custom amount.
1


Re: Damaging a wall by a custom amount.
Infinite Rain has written
Re: Damaging a wall by a custom amount.
Tobey has writtenaddhook("objectdamage","ops.main.objectdamage")
function ops.main.objectdamage(objid,damage,id)
	curwep = player(id,"weapontype")
	if(damage < 0) then
		return 0
	end
	for _,weapon in pairs(weapons) do
		if(weapon[1] == curwep) then
			damage = weapon[2]*weapon[8]
			if(damage < weapon[2]) then
				--if damage is less than amount in mp_wpndmg
				ops.main.explosion(object(objid,"x") + 16,object(objid,"y") + 16,1,damage,id)
				return 1
			elseif(damage == weapon[2]) then
				return 0
			elseif(damage > weapon[2]) then
				ops.main.explosion(object(objid,"x") + 16,object(objid,"y")+ 16,1,damage - weapon[2],id)
				return 0
			end
		end
	end
end
omg has written
1
