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

My click detector wont work (should clone on click)?

Its supposed to make a clone of MyPart when clicked but it wont Error says: Workspace.MyClickDetectorEvent.Script:10: Expected ')' (to close '(' at line 1), got

heres the code:

game.workspace.MyClickDetectorEvent.OnServerEvent:Connect(function()
	
	
	
	local Object = game.Workspace.PartToClone
	local ClonedObject = Object:clone()
	
	
	
	end

1 answer

✓ Accepted answer
game.workspace.MyClickDetectorEvent.OnServerEvent:Connect(function()



    local Object = game.Workspace.PartToClone
    local ClonedObject = Object:Clone(game,Workspace)



    end)


--//Another way of doing it:--\\


game.workspace.MyClickDetectorEvent.OnServerEvent:Connect(function()


    	local Object = game.Workspace.PartToClone
    	local ClonedObject = Object:Clone()
		ClonedObject.Parent = game:GetService('Workspace')
	
	


    end)





You just need to set the parent of the Cloned Object, also close the brackets at the end.

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