Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

explode function not work in script. Which Should I do?

I was creating easy bank robbery and scripted safe model and script was correcting tnts but "explode" function didn't work and i was fixing it, I was sweating as hell that script failed. There is a code:

local tnt = game.Lighting.TNT:Clone()
local tnt2 = game.Lighting.TNT2:Clone()
local explode = Instance.new("Explosion")
explode.BlastPressure = 5000000
explode.BlastRadius = 4
explode.DestroyJointRadiusPercent = 0
explode.Parent = script.Parent

function ontouch()
	tnt.Parent = workspace
	wait(10)
	tnt2.Parent = workspace
	wait(10)
	explode.Position = workspace.Safe.Head
	explode.Visible = true
	script.Parent.Transparency = 1
	script.Parent.CanCollide = false
end

script.Parent.Touched:Connect(ontouch)

1 answer

✓ Accepted answer

It's because tnt explodes immediately when the game starts. You can put these lines from 01 to 07 after the touch event and that will make the explostion appear only at that moment. And make some debounce to prevent WW3.

2 comments

0

lmao I am talking 'bout a c4 works in jailbreak and mad city during the bank robbery

0

I use another script and thx for fixing this annoying error

This discussion is preserved as it was. New answers, comments, and votes are closed.