--Edited by Stickmasterluke

local p = game.Players.LocalPlayer
local c = game.Workspace:WaitForChild(p.Name)
local m = p:GetMouse()
Tool=script.Parent
local part = Instance.new("Part")
part.CanCollide = false
part.Transparency = 1
part.Name = "Aim"
part.Anchored = true
part.Size = Vector3.new(.1,.1,.1)
part.CFrame = c.Torso.CFrame*CFrame.new(0,0,0)
part.Parent = c.Torso
delay(0,function()
	while wait(0.1) do
		part.CFrame = c.Torso.CFrame*CFrame.new(0,0,-3)
		part.CFrame = CFrame.new(part.Position, m.Hit.p)
	end
end)

enabled = true
function onButton1Down(mouse)
	if not enabled then
		return
	end

	enabled = false
	mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"

	wait(.5)
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	enabled = true

end

function onEquippedLocal(mouse)
	if mouse == nil then
		print("Mouse not found")
		return 
	end
	
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end


Tool.Equipped:connect(onEquippedLocal)
