How to make if car touches with a part car destroys?
I tried this and didn’t work.
function onTouched(hit)
if hit.Name == ‘Car’ then
hit:Destroy()
end
end
script.Parent.Touched:connect(onTouched)
How to make if car touches with a part car destroys?
I tried this and didn’t work.
function onTouched(hit)
if hit.Name == ‘Car’ then
hit:Destroy()
end
end
script.Parent.Touched:connect(onTouched)
Can you explain what you want to archive? I seriously didn’t understand.
function onTouched(hit)
if hit.Parent.Name == ‘Car’ then
hit.Parent:Destroy()
end
end
script.Parent.Touched:connect(onTouched)
Try this and when it doesn’t work, can you send us a picture from the car you wanna destroy?
if your car is made of multiple parts you could weld the car together with
https://developer.roblox.com/en-us/api-reference/class/RigidConstraint
and use DestructionEnabled
to make the car fall apart when it collides
and you can lisson for the Broken
propery to change and then use
https://developer.roblox.com/en-us/api-reference/class/Debris
to make the parts destroy after some time