Lets say I have a model that is built from parts, for this example well say its a tower, how can I make it so that when a certain object hits this model, the parts will break down, for example if I want it to be a house and if a certain object hits it then the parts that the object hit will break down from the model
There is a function called Break Joints. Where if I’m correct you can break all of the welds/weldconstraints in a model.
local HitBoxPart = script.Parent.HitBoxPart --the hitbox that you would touch to break the structure
HitBoxPart.Touched:Connect(function(hit)
HitBoxPart:BreakJoints() --break it apart
end)
Use this to detect if a certain object touches it:
local HitBoxPart = script.Parent.HitBoxPart --the hitbox that you would touch to break the structure
HitBoxPart.Touched:Connect(function(hit)
if hit.Name == "Name of object you want it to touch" then
HitBoxPart:BreakJoints() --break it apart
end
end)
This can be bypassed by people with the same username as the “Name of object you want it to touch” part. To avoid this you can make the object’s name under 3 characters.
If you want to detect a certain type of object ask me.
So basically I have to build a structure with Welds and then take care of every Part in the Model that if a specific object touches it it performs the BreakJoints?
yeah! ! ! ! ! ! !! ! !! !! ! !! !! !