local Part = workspace.PvP.PvPZ
local Tool = game.Lighting.Storage:WaitForChild("LinkedSword")

while true do
	for _, Player in pairs(game.Players:GetPlayers()) do
		local Character = Player.Character
		if Character and Player.Backpack:FindFirstChild("LinkedSword") == nil and Character:FindFirstChild("LinkedSword") == nil then
			if (Character.HumanoidRootPart.Position - Part.Position).Magnitude < 30 then
				local Clone = Tool:Clone()
				Clone.Parent = Player.Backpack
				if (Character.HumanoidRootPart.Position - Part.Position).Magnitude > 30 and Player.Backpack:FindFirstChild("LinkedSword") then
					Player.Backpack.LinkedSword:Destroy()
				else
					if Character:FindFirstChild("LinkedSword") then
						Character.LinkedSword:Destroy()
						end
				end
			end
		end
	end
	wait(0.001)
end

I know this is a mess, Im not too good at scripting.