local F=script.Parent local C=nil local R=nil function SetMouseIcon(F,C)if F==nil then return end F.Icon=C==true and"\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\092\071\117\110\067\117\114\115\111\114\046\112\110\103"or"\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\092\071\117\110\087\097\105\116\067\117\114\115\111\114\046\112\110\103"end function onEquippedLocal(I)if I==nil then print("\077\111\117\115\101 \110\111\116 \102\111\117\110\100")return end C=F.Parent:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")R=F.Parent:FindFirstChild("\072\117\109\097\110\111\105\100")if C==nil or R==nil then return end SetMouseIcon(I,F.IsEnabled.Value)F.IsEnabled.Changed:connect(function(F)SetMouseIcon(I,F)end)I.Icon="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\092\071\117\110\067\117\114\115\111\114\046\112\110\103"I.Button1Down:connect(function()script.Parent.MouseClick:FireServer(I.Hit.p)end)I.KeyDown:connect(function(F)script.Parent.KeyPress:FireServer(F)end)end F.Equipped:connect(onEquippedLocal)
--Edited by QS

local Tool = script.Parent
local torso = nil
local human = nil

function SetMouseIcon(mouse, bool)
	if mouse == nil then
		return
	end
	mouse.Icon = bool == true and "rbxasset://textures\\GunCursor.png" or "rbxasset://textures\\GunWaitCursor.png"
end

function onEquippedLocal(mouse)
	if mouse == nil then
		print("Mouse not found")
		return
	end

	torso = Tool.Parent:FindFirstChild("HumanoidRootPart")
	human = Tool.Parent:FindFirstChild("Humanoid") --getHumanoid(Tool.Parent)
	if torso == nil or human == nil then
		return
	end

	SetMouseIcon(mouse, Tool.IsEnabled.Value)
	Tool.IsEnabled.Changed:connect(function(bool)
		SetMouseIcon(mouse, bool)
	end)

	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function()
		script.Parent.MouseClick:FireServer(mouse.Hit.p)
	end)
	mouse.KeyDown:connect(function(key)
		script.Parent.KeyPress:FireServer(key)
	end)
end

Tool.Equipped:connect(onEquippedLocal)
