I dont know why but this script keeps putting down a tower instead of one part. Its suppose to loop and make it so I put one part down at a time but instead it puts down a ton of them stacked on each other and then stops.
Code...
wait(2) local player = game.Players.LocalPlayer local mouse = player:GetMouse() local blankPart = game.Players.LocalPlayer.PlayerGui.BlockGui.Block.Part blankPart.Anchored=true blankPart.CanCollide=false blankPart.Transparency=0.75 local mouseDown = false local connection connection = mouse.Move:Connect(function() if not mouseDown then --wait(0.1) local part = blankPart:Clone() --never change the original part, only a clone part.Parent=workspace mouse.TargetFilter=part --ignore the clone while getting mouse position local moveConn moveConn = mouse.Move:Connect(function() local p = mouse.Hit.p part.Position = Vector3.new(math.floor(p.X),math.ceil(p.Y),math.floor(p.Z)) --mouse position in whole numbers end) mouse.Button1Down:Wait() --do not have to connect a click function :) moveConn:Disconnect() --stop moving the clone part.CanCollide=true part.Transparency=0 end end) mouse.Button1Down:Connect(function() mouseDown = true connection:Disconnect() end)