Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to unlock a parent when destroyed? [SOLVED]

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)

2 comments

0

unlock a parent when destroyed Kinda the point of destroying an object.

0

He wants to create a copy of a part before destroying it and paste wherever his mouse is pointing at on E key press tip mouse movement works at each render frame

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.