Need help with constraint.RemoveAll()

So yah,

Basically, I’m trying to make a SWEP, in the entities/init.lua file I would like to implement the constraint.RemoveAll() but no matter what I tried, I failed. So this is what I want the result to be, when the explosion occurs (cause in my SWEP, the missile makes an explosion) I would like it to remove all the constraints that the Explosion magnitude hurts.

Hope we understand eachother.
Thank You.

for k,v in pairs(constraints) do
v:Remove()
end

Definitly will not work, gives a general idea. 1 second code ftw?

lol, won’t work, need something else.

Did you not understand. I clearly know that will not work. It is for the general idea mate, I don’t get what you are trying to do either, tbh.

I wasen’t trying to hurt you or anything just said it didn’t work, but anyway, I’ll explain more, you probably know Gbombs? These entities have the ability to remove any constraints. I read their code, tried implementing it my way in my code, it didn’t work, now I would like to know if anyone knows a way to make it so that when an explosion occurs, lets say env_explosion which is the one I use, it destroys every constraints.

Oh yeah, GetInSphere or something, Btw i wasn’t mad at all. Sorry if it came out that way.

[lua] for _, v in pairs(ents.FindInSphere( self.Entity:GetPos(), whatever radius you want, this is just a number i.e. 100 )) do
v:Fire(“enablemotion”,"",1) – unfreezes the props as far as i know
constraint.RemoveAll( v ) – gets rid of your constraints [/lua]

That’s from Garry’s Bombs, why doesn’t it work for you? How are you implementing it?

EDIT: Wait… you’re making a swep. Hurm. I think that’s the problem, as something needs to be done differently but I am not sure how to workaround that. Hope you get your answer soon mate. Best of luck.

There you go, That should help you out. Well done, pidgey.

Ok, Ive read that script already but thanks. Uhm then I’ll ask a favor, can anyone make a code, that would basically do the following? When my bullet explodes, it removes all constraints that the explosion affects.
If it is unclear, tell me and I will reformulate.

EDIT: Thanks for your help, but I found the way how I could make it work, similar from the one Le Pidgey posted.

Please post the code that helped you?