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 7 years ago

I have this script:

01while wait() do
02    local distance = math.floor((player.Character:WaitForChild("HumanoidRootPart").Position - mouse.Hit.p).magnitude)
03    if ibreak and distance <= 15 then
04        if mouse.Target.Name == "Dirt" or mouse.Target.Name == "Grass" then
05        clone.Name = player.Name.."'s plant."
06        ibreak = false
07        canbeclicked = true
08        ClickedButton = false
09        MMN()
10        break
11           end
12        end
13    if mouse.Target ~= nil then
14 
15    clone.Parent = game.Workspace
View all 26 lines...

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
6 years ago
Edited 6 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 — 6y
0
xd ok BielNS 40 — 6y
Ad

Answer this question