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

The Parent property of StarterFlower is locked, current parent: NULL, new parent Workspace?

I have this script:

	while wait() do
		local distance = math.floor((player.Character:WaitForChild("HumanoidRootPart").Position - mouse.Hit.p).magnitude)
		if ibreak and distance <= 15 then
			if mouse.Target.Name == "Dirt" or mouse.Target.Name == "Grass" then
			clone.Name = player.Name.."'s plant."
			ibreak = false
			canbeclicked = true
			ClickedButton = false
			MMN()
			break
			   end
			end
		if mouse.Target ~= nil then 
			
		clone.Parent = game.Workspace
		local distance = math.floor((player.Character:WaitForChild("HumanoidRootPart").Position - mouse.Hit.p).magnitude)
		if mouse.Target.Parent.Name ~= script.Parent.Name then
		clone:MoveTo(mouse.Hit.p)
		      end
		   end
		if Canceled then
			clone:Destroy()
			print("Clone's gone!")
			Canceled = false
		end
	end

I get a error everytime when I click to Cancel and to destroy the model that says:

17:38:34.699 - The Parent property of StarterFlower is locked, current parent: NULL, new parent Workspace 17:38:34.700 - Stack Begin 17:38:34.701 - Script 'Players.wilsonsilva007.PlayerGui.Inventory.Background.Starter_Flower.ImageBackground.Image.StarterFlower.LocalScript', Line 88 17:38:34.702 - Stack End How do I fix this?

1 answer

✓ Accepted answer

I dont see the "Clone" Variable, But i had the same error here, and i found how to fix it, First you need to move the "clone" variable, to teh event, i mean u need to clone it more than 1 time if you want to delete it, or it will count only as one, and you cant destroy 1 clone multiple times, soo try moving the "clone variable" to the event/line where it will move. (Also if i sound bad its cuz im really bad at explaining).

2 comments

0

You know this was 1 year ago right? xD Anyways I done that 1y ago and it worked so u get an accepted answer.

0

xd ok

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