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

Help with the :Clone command it's not working?

Asked by 4 years ago

I need help with the :clone part in my code on line 12. I have tried it and it didn't work. Is it part of the clicking part or the :clone part exactly?

Here is the code:

local ClickDetector = script.Parent.ClickDetector

ClickDetector.MouseHoverEnter:Connect(function()
    game.Workspace.PlantExample.Position = script.Parent.Position
end)

ClickDetector.MouseHoverLeave:Connect(function()
    game.Workspace.PlantExample.Position = game.Workspace.PlantExampleStay.Position
end)

ClickDetector.MouseClick:Connect(function()
    game.Workspace.PlantExample:Clone()
end)

Anyone?

0
Could we prehaps get the error? Qariter 110 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You have to set the parent, like:

game.Workspace.PlantExample:Clone().Parent = game.Workspace
0
Be sure to mark it as the answer if this answered your question. JailBreaker_13 350 — 4y
Ad

Answer this question