Ad
Log in to vote
0

simple click detector clone script?

Asked by
Nimbzee 14
1 year ago

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)
0
Where do you want the clone to be in? Gingerely 245 — 1y
0
workspace Nimbzee 14 — 1y
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 Gingerely 245 — 1y
0
also is that a script for gui or a part Gingerely 245 — 1y
0
its for a part, and i tried what you said and im confused because it didnt work Nimbzee 14 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago
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)
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 Gingerely 245 — 1y
0
thanks guys! Nimbzee 14 — 1y
Ad

Answer this question