not working

I was trying to make a script that creates an “explosion” when touched.
But the is not working

Server script inside of a part:

local exploded = false

function touched(hit)
	if not exploded then
		exploded = true

		local explosion ="Part")
		explosion.Name = "explosion"

		explosion.Shape = Enum.PartType.Ball
		explosion.Color =, 0.643137, 0.352941)

		explosion.Anchored = true
		explosion.Position = hit.Position


“touched” prints inside dev console. this means I have a problem with the
Any help is appreciated.

Assuming you are trying to get the Instance Explosion: You are Creating a part, not an Explosion

local Debris = game:GetService("Debris")
local Hum = hit.Parent:FindFirstChild("Humanoid")

if Hum then
local Explosion ="Explosion")
Explosion.Position = hit.Position
Debris:AddItem(Explosion, 3)


I misread, And i made a mistake, you arent putting the “Explosion” in the Workspace

So this:

local Debris = game:GetService("Debris")
	if hit.Parent:FindFirstChild("Humanoid") then
local Explosion ="Explosion", workspace)

		Explosion.Position = hit.Position
		Debris:AddItem(Explosion, 1.1)

Make sure you add your Items into the workspace or into a Item IN the the workspace

No, i dont want to make an actual explosion. I am making a part that looks like one so it fits my games style.

This is all you need to read then

Alright. I will try it tomorrow. I am going to bed

You need to parent the instance that has been created.
For example"Part", game.Workspace)

Hope this helps :slightly_smiling_face:

Already did that here in the Posts above

Yeah, I just forgot to parent the part to workspace. It was late at night and I was kinda dumb… lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.