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

How do I make an explosion?

I've got this code

local Values = script.Parent.Values
local Huge = 100000

Values.Boom.Changed:connect(function()
	local Nuke = Instance.new("Explosion")
	Nuke.Position = Main.Console.ConsoleM.Position
	Nuke.BlastPressure = Huge
	Nuke.BlastRadius = Huge
	Nuke.ExplosionType = Enum.ExplosionType.CratersAndDebris
end)

Can someone explain how to fix this?

2 comments

5

Helps if you tell us what's wrong. I'll just tell you that Main is nil, and then wait for you to actually do this right.

1

Dam right about that

1 answer

I am not exactly sure what your error is but what I see is that your script doesn't know what to do. You can try this but I am not sure it will work.

function Boom()
    local Nuke = Instance.new("Explosion")
    Nuke.Position = --"Main" .Console.ConsoleM.Position
    Nuke.BlastPressure = 100000
    Nuke.BlastRadius = 100000
    Nuke.ExplosionType = Enum.ExplosionType.CratersAndDebris
end
Values.Boom.Changed:connect(Boom)

1 Last thing. the part I have in parathesis thats green is also your error. Define the "Main" so it knows what where to position it. If this doesn't work please define what your error is up above.

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