Some questions about destructible parts

Hey!
I’m trying to make a fully destructible world, And I’m having problems with some things.

  1. I have old buildings that weren’t built with weld, Only with anchor. Is there a way I can weld all parts inside of them at once, Instead of just adding them with the tool? (Which will take alot of time).

  2. How can I make the fallen parts cause less lags, For example, Disappear after some seconds?

  3. Is there a way to make the bigger parts of the buildings split into smaller ones with the same material and color, when touching an explosion, Instead of just deleting them and making instead smaller parts?

  4. How can I make the unanchored destructible buildings stick to the ground?

  5. I heard you can somehow change the “weight” of a part, means when it comes in touch with explosion, It won’t just fly away but will fall not far away from the explosion. Is it possible, Or the only thing that changes it the explosion strength

Thanks!

1 Like
  1. There are many welding plugins for you to look into.

  2. You can use the Debris AddItem method, or you could use a delay()

  3. Although you could technically use run-time CSG to cut them, it is easier and probably faster to just delete and replace with multiple chunk pieces.

  4. Weld to the floor?

  5. In the properties window with a part selected, you’ll see an option to check off on custom physical properties. Once you check it off, you can increase the density value.

  1. But where? I tried doing this in the rocket launcher script:
    wait(7)
    TouchPart:destroy()

  2. What is CSG?

  3. Yes, Weld to the baseplate.

  4. I clicked it, But I don’t see any new settings or properties.

game:GetService(“Debris”):AddItem()

i personally don’t use debris and instead destroy so it might be wrong

I tried destroy() too, For some reason not working…

And where should I put “game:GetService(“Debris”):AddItem()”?

2 Using a wait() will cause the thread to hang for 7 seconds. Instead, you should use a delay.

delay(7, function()
    Part:Destroy()
end)

3 CSG is the unioning and negating thing.

5 You have to open the drop-down I think

2 Likes

For some reason it’s still not working.
Is something wrong with the code?

    if ExplodeEvent then
		Rocket.Touched:Connect(function(TouchPart)
			if not IGNORE_LIST[string.lower(TouchPart.Name)] and not TouchPart:IsDescendantOf(Character) then
				ExplodeEvent:FireServer(Rocket.Position)
				delay(7, function()
   					TouchPart:Destroy()
				end)

You have parts stored in the ignore list by name and you probably have multiple parts of the same name and they’ll all count as ignored.

Store them as IGNORE_LIST[Object] = true and then to check if it’s ignored just check IGNORE_LIST[Object]

There’s nothing stored in the ignore list, And even when I tried putting this right after "Rocket.Touched:Connect(Function(TOuchPart), Still not working…
Is there a script which I can just put inside the model which will destroy his children if blew up?

The Destroy() function calls itself on all of the children of the object you called it on, destroying all of its descendants.

Then what’s wrong with the code…?

if ExplodeEvent then
	Rocket.Touched:Connect(function(TouchPart)
	delay(7, function()
		TouchPart:Destroy()
	end)
		if not IGNORE_LIST[string.lower(TouchPart.Name)] and not TouchPart:IsDescendantOf(Character) then
			ExplodeEvent:FireServer(Rocket.Position)
			if callFunction == false then
				callFunction = true
				LocalTouchSound:play()
				wait(0.5)
				callFunction = false
			end
		end
	end
)end

end

You’re trying to have the model destroyed, yes? Is at least the touch part being destroyed?

The touch parts, All parts that are touched by the explosion.

Is at least the touch part being destroyed?

When I look closely, Both my hand and one single part out of all fallen parts is being destroyed…

I believe your destroy function is run before the whitelist checker.

if ExplodeEvent then
	Rocket.Touched:Connect(function(TouchPart)

		if not IGNORE_LIST[string.lower(TouchPart.Name)] and not TouchPart:IsDescendantOf(Character) then
	delay(7, function()
		TouchPart:Destroy() -- moved it here
	end)
			ExplodeEvent:FireServer(Rocket.Position)
			if callFunction == false then
				callFunction = true
				LocalTouchSound:play()
				wait(0.5)
				callFunction = false
			end
		end
	end
)end

That’s what I did before, Now my hand is not being destroyed, But only one part is being destroyed.

Switch it from Touch:Destroy to Touch.Parent:Destroy()

Then it will destroy the whole model…
I only want to destroy the parts that are no longer connected to the rest of the buildings, The parts that were affected by the explosion and fell off.