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)
Lock will be always 1, you either have to remove the line where it checks it, or make something for it to not be 1
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 was the problem if not lock == 1 then bang.Position = game.Workspace.specialexplosionpart2.Position wait(2) bang.parent = game.Workspace end end end)