local debounce = false
script.Parent.Touched:Connect(function(hit)
if not debounce then
debounce = true
local char = game.Workspace.CharlotteOfficeDoor(hit.Parent)
if char == nil or char.CharlotteOfficeDoor:FindFirstChild("HumanoidRootPart") == nil then return end
char.CharlotteOfficeDoor.HumanoidRootPart:Destroy()
debounce = false
end
end)
Since accessory models are parented to their Accessory object and not the character, this method is no longer viable (although enviously simple .)
The best practice that will give you the least issues currently is using FindFirstAncestorOfClass on your hit part to find the ancestor Model, then using Players:GetPlayerFromCharacter(ancestorModel) to confirm that your model belongs to a player and as such means it is a character.
I wish it was still this easy but using hit.Parent will give you inconsistent results. Cheers!