i'm using debris to destroy a part but whenever i do and try to respawn the part back into workspace it gives me this error:
17:42:40.291 - The Parent property of Lightning is locked, current parent: NULL, new parent Workspace
i'm not sure if destroy is a better option in this case or i'll do the same thing, i'm just wondering how i can unlock the parent
script:
UIS.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then if debounce == true then debounce = false clone.Parent = game.Workspace local mousePos = mouse.Hit.p clone.Position = mousePos debris:AddItem(game.Workspace.Lightning, 3) debounce = true end end end)
You cannot destroy an object (via debris or Destroy()) and expect to use it again. You can set the transparency to 1 instead or change parent to the ServerStorage.
delay(3, function() game.Workspace.Lightning.Parent = game.ServerStorage end)