I am trying to make my part clone a Model called SimpleStructure from ReplicatedStorage to Workspace. I am getting error an error that says "SimpleStructure is not a valid member of Workspace". I Don't know how to change my script to work (More info on bottom)
SP = script.Parent -- Variable
SP.ClickDetector.MouseClick:connect(function(clicked) -- When clicked, this function is called
SimpleStructure = false -- Makes SimpleStructure False to clone it
if game.Workspace.SimpleStructure == true then -- If SimpleStructure is true, it was cloned so destroy this part
SP:Destroy() -- Destroys the part
end -- This if statement is over
wait(0.1)
if game.Workspace.SimpleStructure == false then -- Check to see if SimpleStructure is false, meaning not cloned
game.ReplicatedStorage.SimpleStructure:Clone() -- Goes to ReplicatedStorage and takes SimpleStructure
wait(0.1)
game.ReplicatedStorage.SimpleStructure:Clone().Parent = game.Workspace -- Clones SimpleStructure into Workspace
end -- This if statement is over
end)-- Function is over
I think I have a bunch of problems? I have two if statements because I want this script to not be able to be clicked multiple times and clone the Model over and over while being clicked. So I thought of making it mark SimpleStructure. I want it to be able to see if SimpleStructure is inside of Workspace or not. If it is, Destroy the brick you need to click. If it isn't Clone it into Workspace.

2 comments
Thank you so much! I never learned about FindFirstChild YET. This was a big help.
no problem! Glad I could help!