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?
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).