I have tryed lots of functions and they dont work, can you tell me what I exactly have to do? I want it so when my tool is not active to disable this script and when it is active enable it. It doesnt have anything to do it right now. Here is my 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
while true do
wait(0.2)
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

2 comments
connect is deprecated, switch to Connect. :wait is deprecated, switch to :Wait.
Ok, I did but that doesnt work.