Cloning not working

So, I made it where when you click on a part it will disappear. The thing is that part is a local part and is being cloned. Whenever I click on the part is does disappear, but when I reset the part is back. Its not supposed to be back, its supposed to be destroyed forever.

Here’s what I got going on so far. I have a local script in StarterPlayerScripts:

local Part = game.Workspace.Camera:WaitForChild("Dirt")
local Sound = game.ReplicatedStorage.Music

function onClicked()
	Sound:Play()
	Part:Destroy()
end 
workspace.Camera.Dirt.ClickDetector.MouseClick:connect(onClicked)

And I also have a local script in StarterGui which is cloning the part and storing it in camera:

local Part = game.ReplicatedStorage.Dirt:Clone()

Part.Parent = game.workspace.CurrentCamera

Finally I have a dirt model (which is the part) located in ReplicatedStorage:

Screenshot (573)

So to sum it up, whenever I join and click on the part it disappears which is what I want. But whenever I reset the part comes back which is not what I want. I want it gone forever. Thanks so much.

Everything that is in StarterGui will be cloned, therefore the scripts are activated, change the location of this script to StarterPlayerScripts.

1 Like

Thanks so much, kinda expected it too be an easy fix. I just started this scripting stuff and am usually having a lot of easy fixable problems.

1 Like

You’re welcome, over time you’ll learn more and be better, don’t worry.

1 Like