local region = game.Workspace.Region
local posa = region.Position - (region.Size / 2)
local posb = region.Position + (region.Size / 2)
local swordzone = Region3.new(posa, posb)
while wait(1) do
	local torsos = {}
	for i, v in pairs(game.Players:GetPlayers()) do
		if v.Character then
			if v.Character:FindFirstChild("Torso") then
				table.insert(torsos, v.Character.Torso)
			end
		end
	end
	local plrquery = workspace:FindPartsInRegion3WithWhiteList(swordzone, torsos, 5000)
	for i, v in pairs(plrquery) do
	if game.Players:GetPlayerFromCharacter(v.Parent) then
		local plr = game.Players:GetPlayerFromCharacter(v.Parent)
		if plr.Backpack:FindFirstChild("ClassicSword") == nil and plr.Character:FindFirstChild("ClassicSword") == nil then
				local sword = game.Lighting.ClassicSword:Clone()
				sword.Parent = plr.Backpack
			spawn(function()
					while wait(.5) do
						if table.find(plrquery, plr.Character:WaitForChild("Torso")) == nil then
							print("left region")
							break
					end
				end
			end)
		end
	end
	end
end

The player receives the sword but is not removed of it when they leave.

1 comment

0

make invisible unseen platform around of the normal platform which is removes sword from backpack