PvP Zone not working

Currently, I am making a Sword PvP Zone in my game.

local zone = script.Parent
local sword = game.ReplicatedStorage.Sword
local debounce = false
zone.Touched:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player and debounce == false then
		if not player.Backpack:FindFirstChild("Sword") and not hit.Parent:FindFirstChild("Sword") then
			local clone = sword:Clone()
			clone.Parent = player.Backpack
			debounce = true
		end
	end
end)

zone.TouchEnded:Connect(function(no)
	local player = game.Players:GetPlayerFromCharacter(no.Parent)
	if player.Backpack:FindFirstChild("Sword") then
		player.Backpack.Sword:Destroy()
	else
		local swordpos = no.Parent.Sword.Handle.Position
		if swordpos.X < zone.Position.X - zone.Size.X/2 or swordpos.X > zone.Position.X + zone.Size.X/2 or swordpos.Z < zone.Position.Z - zone.Size.Z/2 or swordpos.Z > zone.Position.Z + zone.Size.Z/2 then
			no.Parent.Sword:Destroy()
		end
	end
	debounce = false
end)

This script doesn’t work. It gives you the sword when you enter it and removes the sword if you exit the zone, but if the sword is equipped it won’t remove your sword. How can I fix this?

This may be a nice solution to your problem: Zone+ v2

It may not work because the tool is equipped, when a tool is equipped its located in the character so what I would do is just unequipped before you destroy it.

I’m not quite sure how to do that, I’ve tried finding the player model but that doesn’t seem to work

use the “Character” property in the player

What? Why wouldn’t it work? just go through destroying all tools within player backpack and on the character itself.

Also yea you need to destroy the equipped tool which is on the character itself