local e={}function GetConnection(l)for e,Z in pairs(e)do if Z==l then return true end end return false end game.Players.PlayerAdded:connect(function(l)l.CharacterAdded:connect(function(Z)Z.ChildAdded:connect(function(Z)if Z:IsA("\084\111\111\108")and not GetConnection(Z)then Z.Changed:connect(function(e)if Z and(Z.Parent~=nil and e=="\080\097\114\101\110\116")then wait(.033333333333333)local e=Z:FindFirstChild("\072\097\110\100\108\101")if Z.Parent==workspace then if e and(e:CanSetNetworkOwnership()and l)then e:SetNetworkOwner(l)end else if e and(e:CanSetNetworkOwnership()and l)then e:SetNetworkOwnershipAuto()end end end end)table.insert(e,Z)end end)end)end)while true do wait(1)for l,Z in pairs(e)do if Z.Parent==nil then e[l]=nil end end end


local connectedtools = {}

function GetConnection(tool)
	for _,v in pairs(connectedtools) do
		if v == tool then
			return true
		end
	end
	return false
end

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		char.ChildAdded:connect(function(child)
			if child:IsA("Tool") and not GetConnection(child) then
				child.Changed:connect(function(property)
					if child and child.Parent ~= nil and property == "Parent" then
						wait(1/30)
						local handle = child:FindFirstChild("Handle")
						if child.Parent == workspace then
							if handle and handle:CanSetNetworkOwnership() and plr then
								handle:SetNetworkOwner(plr)
							end
						else
							if handle and handle:CanSetNetworkOwnership() and plr then
								handle:SetNetworkOwnershipAuto()
							end
						end
					end
				end)
				table.insert(connectedtools,child)
			end
		end)
	end)
end)

while true do --clean table
	wait(1)
	for i,v in pairs(connectedtools) do
		if v.Parent == nil then
			connectedtools[i] = nil
		end
	end
end
