Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

simple click detector clone script?

How can I make a click detector script that clones an object into the workspace? is it something like

local part = game.Workspace.part
local clonepart = part:Clone()

script.Parent.MouseButtonDown:Connect(function()
--clone script thing that i dont know how to do
end)

5 comments

0

Where do you want the clone to be in?

0

workspace

0

So you would make the clone line in the mouse button down, and dont forget to parent the part or else it would be in the game just not visible because its a child of nothing, you can do part.Parent = game.Workspace

0

also is that a script for gui or a part

0

its for a part, and i tried what you said and im confused because it didnt work

1 answer

✓ Accepted answer
local part = workspace.Part -- Defines the part

script.Parent.MouseClick:Connect(function()
	local part2 = part:Clone() -- Clones the original part
	part2.Parent = workspace -- Parents the part to workspace (already in it lmao)
end)

2 comments

0

Yes that ^ lol ;-; you cant do MouseButtonDown for a click detector plus your part did not have a parent. so @xTake_Away is right

0

thanks guys!

This discussion is preserved as it was. New answers, comments, and votes are closed.