When a part touched another part (lava) all welds that are attached to the part get destroyed
example - an unanchored car hits a rock and the part that touched the rock falls of the car ( like in those old 2010 games )
the car is welded together so it doesn't fall apart.
v - the script ( lava part ) - v
1 | script.Parent.Touched:Connect( function (hit) |
2 | local all = hit:FindFirstChild( "Weld" ) |
3 | all:Destroy() |
4 | end ) |
I could just make the part disappear with a script, but that's lame.
1 | script.Parent.Touched:Connect( function (hit) |
2 | local all = hit:FindFirstChildOfClass( "Weld" ) or hit.Parent:FindFirstChildOfClass( "Weld" ) |
3 | repeat |
4 | all = hit:FindFirstChildOfClass( "Weld" ) or hit.Parent:FindFirstChildOfClass( "Weld" ) |
5 | if all then |
6 | all:Destroy() |
7 | end |
8 | until all = = nil |
9 | end ) |
I haven't tested it but maybe it would work
01 | script.Parent.Touched:Connect( function (hit) |
02 | local humanoid = hit.Parent:FindFirstChild( "Humanoid" ) |
03 | if humanoid ~ = nil then |
04 | return |
05 | else |
06 | local all = hit:FindFirstChildOfClass( "Weld" ) or hit.Parent:FindFirstChildOfClass( "Weld" ) |
07 | repeat |
08 | all = hit:FindFirstChildOfClass( "Weld" ) or hit.Parent:FindFirstChildOfClass( "Weld" ) |
09 | if all then |
10 | all:Destroy() |
11 | end |
12 | until all = = nil |
13 | end |
14 | end ) |