I made this script:
function sit(child) if child.Name == "SeatWeld" then character = child.Part1.Parent if player.Value ~= character.Name then -- check if the player is the one I want child:Destroy() end end end script.Parent.ChildAdded:connect(sit)
It's supposed to destroy the seatweld when an undesired player sits, but when I tried to seat there, it didn't work and the output said this: Something unexpectedly tried to set the parent of SeatWeld to NULL while trying to set the parent of SeatWeld. Current parent is Seat. What is wrong? I didn't try to change it's parent, so why that error?
This error happens when an event tries to remove something immediately after its parent is set. To get around it, add the weld to Debris instead:
game:GetService("Debris"):AddItem(child,0)