Prevent effect on char

Hello, I was trying to make a kill effect which when a player gets kills the effect happens, although the issue is if the player who has the sword with the effect dies, the effect happens to them…


local Main = script.Parent
local DistributedScripts = {}

Main.Touched:Connect(function(hit)
	local Humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
	if Humanoid then
		local Torso = hit.Parent:FindFirstChild("UpperTorso")
		if Torso then
			local Found = false
			for i=1,#DistributedScripts do
				if DistributedScripts[i].Parent == Torso then
					Found = true
				end
			end
			if not Found then
			
					local BurnScript = script:FindFirstChildOfClass("Script"):Clone()
				DistributedScripts[#DistributedScripts+1] = BurnScript
				BurnScript.Parent = Torso
				BurnScript.Disabled = false
			end
		end
	end
	end)

while Main do
	local PartsInside = Main:GetTouchingParts()
	for i=1,#PartsInside do
		local Humanoid = PartsInside[i].Parent:FindFirstChildOfClass("Humanoid")
		if Humanoid then
			local Torso = PartsInside[i].Parent:FindFirstChild("UpperTorso")
			if Torso then
			
				local Found = false

				for i=1,#DistributedScripts do
					if DistributedScripts[i].Parent == Torso then
						Found = true
					end
				end
				if not Found then
				
					local BurnScript = script:FindFirstChildOfClass("Script"):Clone()
					DistributedScripts[#DistributedScripts+1] = BurnScript
					BurnScript.Parent = Torso
					BurnScript.Disabled = false
				end
			end
		end
	end
	wait(.5)
end

Is there anyway to fix this?