I have created a part on client only, and I want it to be removed after 1 second of being parented to game.Workspace. This would seem very simple and easy, but I have tried using the Debris:AddItem method, as well as Instance:Destroy()
I am trying to remove this part via Local Script.
I do not understand why this is not as simple as it should be.
The local script attempting to removed it (currently a mess):
local Debris = game:GetService("Debris")
while wait() do
game:GetService("Debris"):AddItem(game.Workspace.Part, 1)
end
game.Workspace.DescendantAdded:Connect(function(part)
print("hey")
if part.ClassName == "Part" and part.Name == "Part" and not (part:FindFirstChild("SelectionBox")) then
print("debris?")
Debris:AddItem(part,1)
end
end)
the makePartm() function gets called in the full script, and the part is created, as intended.
Though the other script doesn’t even print anything. I assume the function doesn’t work locally, but I can’t find any other way that does work locally.