Hi, i have an explosion script but it doesn't appear to work. It's supposed to explode a part once another part is touched Any ideas? Script:
local lock = 0
script.Parent.Touched:Connect(function(hit)
local bang = instance.new("Explosion")
local h = hit.Parent:FindFirstChild("Humanoid")
bang.BlastPressure = 67
bang.BlastRadius = 40
if h ~= nil then
lock = lock +1
if not lock == 1 then
bang.Position = game.Workspace.specialexplosionpart2.Position
wait(2)
bang.parent = game.Workspace
end
end
end)

2 comments
Maybe add the parent first before changing the position?
Hmm, seems to just spawn the explosion in a random position. I'm going to try re-installing Roblox Studio. May just be my computer or something like that.