I got a model for Wingman8’s 2009 fragmentation script, I’d like to learn how to use it since it’s like 1k lines of code and I don’t understand the explanation in there.
Hello! I would be happy to help. Are you able to link the script or tell me what you don’t understand, and I would be happy to explain it for you.
Thank you so much for the script! Give me a couple of minutes, and I will try to help you!
Hello! After a lot of research and debugging. I have found out how the script works for you!
The main purpose of this script is just to save time, really. So instead of having to manually place multiple smaller parts to simulate destruction, you only need to place one part. When an event is triggerd for example, a cannonball hitting a wall, the script will automatically generate smaller fragments to simulate the wall breaking.
The setup
To use the script, you have to create two parts
Foundation - This part is needed without it, the script won’t work. IMPORTANT: THIS PART WILL NOT BE AFFECTED BY THE FRAGMENTATION
FragWall - This is the part that gets fragmented.
Your Explorer window should look something like this
This is what my setup looks like, the blue part is the foundation, and the red part is the frag wall.
Here is a video showing the fragmentation in action.
The fragmentation script itself stays unchanged. Below is the test script I used to trigger the fragmentation:
local model = workspace:WaitForChild("Model"):WaitForChild("Model")
local part = model:WaitForChild("FragWall")
if shared.FragHandler[part] then
shared.FragHandler[part](part.Position + Vector3.new(5,0,0), true)
part.Anchored = false
else
for k,v in pairs(shared.FragHandler) do
part.Anchored = false
end
end
NOTE: Fragmentation is very difficult to do.
// Forgot to add the following//
On the fragmentation script ( Line 64 - 65 ), you can change the foundation model name so it doesn’t have to be called “foundation” Here is an example below.
local FragModel = script.Parent
local Foundation = FragModel.YOURMODELNAMEHERE
Could you share what you’ve tried so far? Even a rough code snippet helps a lot — it’s much easier to guide you in the right direction when we can see your approach.
Also, if you’re getting any errors in the Output window, those would be really helpful too!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

