Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

Log in to vote
2
Answered by
BielNS 40
5 years ago
Edited 5 years ago

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

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. wilsonsilva007 373 — 5y
0
xd ok BielNS 40 — 5y
Ad

Answer this question