So I'm trying to make it that if a player or a humanoid touches a part, it will explode.
But it seems to only work once. If I try to touch the part again it will give me this error:
The Parent property of explosion is locked, current parent: NULL, new parent Torso
I know it has something to do with this part of the code:
local explosion = Instance.new("Explosion")
explosion.BlastPressure = 100
explosion.BlastRadius = 6
explosion.DestroyJointRadiusPercent = 0
explosion.Parent = game.Workspace
explosion.Position = script.Parent.Position
hit.Parent.Humanoid:TakeDamage(50)
But I don't know what's wrong with it.
I've looked everywhere for an answer but I can't seem to find one that brings a solution to my problem. Explosions remove themselves in a few seconds so I know I don't need to remove it with the script. Please help. Thanks.

1 comment
Put more of your code in the post. Usually parents are locked because you call Destroy on an object.