I have made a custom car and I am attempting for it to be anchored when no one is driving it and for it to become unanchored when someone is inside the car. I have my script down below. Is there something wrong with it or what should I add to it?
wait(0.1)
function unanchor (m)
for _,i in pairs (m:GetChildren()) do
if i:IsA("BasePart") then
i:MakeJoints()
i.Anchored = false
else
unanchor(i)
end
end
end
unanchor(script.Parent)

7 comments
What's wrong with it? Are there any errors?
There aren't any errors, but there might be something wrong with the parents and the Base
Test it and tell me what's in the output. If there's no errors, there's no reason to post something here.
Here is the error it says: 18:35:33.172 - DataModel Loading http://assetgame.roblox.com/Asset/?id=398542823 18:35:33.338 - Mode 2 failed: "Unable to create D3D device: 887a0004" 18:35:33.339 - Trying mode 3...
That's not related to this script. You didn't connect any Seating event (ChildAdded).
Okay
Guys there is not an error like Bunny said. u_g there is a reason to post the question because its not working and there is no error