How to make a anti combat log script with the FE GUN kit by thienbao2109?

  1. What do you want to achieve? Keep it simple and clear!
    I am trying to make an anti combat log script that prevents players from leaving during a fight and if they do so, they lose items or money, etc. I am trying to accomplish this with the FE GUN kit by thienbao2109.
  2. What is the issue? Include screenshots / videos if possible!
    The issue is I have no idea how to accomplish this as there are no or barely any tutorials on how to make an anti combat log script. And the developer himself did not explain how to however it is possible as I’ve a game do this before(Life Sentence) which uses the FE gun Kit and has a anti combat log.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried looking up any possible solutions such as learning how to do creator tags but in my favor, I was unable to make them work with the gun script as it has many modules and different layers so no idea where to put it. I did manage to find a combat log script that somewhat works, only the person who loses health gets in combat status while the person who does the damage does not which is not what I want. Incase anyone wants to see the combat script I mentioned, I listed it below. It is a local script and was placed in starter character scripts.
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local v = Char:WaitForChild("Humanoid")
local cs = game:GetService("CollectionService")
local GUI = Player.PlayerGui.InCombat

local ActualHealth = 100
v.Changed:connect(function (p)
	if (p == "Health") then
		print(v.health)
		local delta = ActualHealth - v.Health
		ActualHealth = v.Health
		if delta >= 1 then


			spawn(function()
				if not cs:HasTag(v.Parent, "InCombat") then
					print("Before Tag")
					cs:AddTag(v.Parent, "InCombat")
					cs:AddTag(Char.Parent, "InCombat")
					print("Has Tag")
					GUI.Enabled = true
				end
			end)
		end




		spawn(function()
			if cs:HasTag(v.Parent, "InCombat") then
				wait(5)
				cs:RemoveTag(v.Parent, "InCombat")
				cs:RemoveTag(Char.Parent, "InCombat")
				print("Removed Tag")
				GUI.Enabled = false
			end
		end)
	end
end)