I making a script to place clones of my union at the position of the mouse and it works but it makes towers of them, how can I fix this?

mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:connect(function()

	mouse.Button1Down:connect(function(Hit)
		local Road = game.Workspace.Road
		local Clone = Road:Clone()
		Clone.Parent = game.Workspace
		local x = mouse.Hit.X
		local y = mouse.Hit.Y
		local z = mouse.Hit.Z
		Clone.Position = Vector3.new(x,y,z)
		

	end)

end)

2 comments

0

Maybe a debounce problem?

0

why is the same event inside of itself? Also on an off note, this script wouldn't work with a filter enabled game