So I am making a destructible car, and I am making a script that prevents any bricks from levitating.
I need a "if not touched then" statement. I searched for an hour or 2, and I couldn't find anything I need.
Here is my script, but its the opposite of what I want:
local function onTouch(otherPart)
print("test1")
script.Parent.WeldConstraint:Destroy() -- this is the thing i want it to do when not touching
--any parts at all
end
script.Parent.Touched:Connect(onTouch)
Sorry for any bad spelling errors, or the fact that I can't make a good script, I am a noob in both lua and english.
Why not make a filter to filter what parts can damage your car? like this:
car part.Touched:Connect(function(touchedpart) if touchedpart is named car part, then return false else car part.Anchored = false or whatever damage system you are using end)