Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- player=game.Players.LocalPlayer
- mouse=player:GetMouse()
- mtarget
- down
- function clickObj()
- if mouse.Target == nil and mouse.Target.Name == {"WallX1","WallX2","WallZ1","WallZ2","Roof","Floor","Baseplate"} then
- mtarget = mouse.Target
- print(mtarget)
- mouse.TargetFilter = mtarget
- print(mouse.TargetFiletr)
- down = true
- end
- end
- mouse.MouseButton1Down:Connect(clickObj)
- function mouseMove()
- if down and mtarget then
- local posX,posY,posZ = mouse.Hit.X,mouse.Hit.Y,mouse.Hit.Z
- mtarget.Position = Vector3.new(posX,posY,posZ)
- end
- end
- mouse.MouseMove:Connect(mouseMove)
- function mouseDown()
- down = false
- mtarget = nil
- mouse.TargetFilter = nil
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement