I need help with my block placer script that's not working right?
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...
02 | local player = game.Players.LocalPlayer |
03 | local mouse = player:GetMouse() |
04 | local blankPart = game.Players.LocalPlayer.PlayerGui.BlockGui.Block.Part |
05 | blankPart.Anchored = true |
06 | blankPart.CanCollide = false |
07 | blankPart.Transparency = 0.75 |
09 | local mouseDown = false |
12 | connection = mouse.Move:Connect( function () |
15 | local part = blankPart:Clone() |
17 | mouse.TargetFilter = part |
19 | moveConn = mouse.Move:Connect( function () |
21 | part.Position = Vector 3. new(math.floor(p.X),math.ceil(p.Y),math.floor(p.Z)) |
23 | mouse.Button 1 Down:Wait() |
30 | mouse.Button 1 Down:Connect( function () |
32 | connection:Disconnect() |