Problem with creator tag

hello, im trying to make creator tag work

  1. What do you want to achieve? Keep it simple and clear!
    I want to make creator tag work
  2. What is the issue? Include screenshots / videos if possible!
    screenshot
    Here is the screenshot of a gun on Explorer
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i searched about creator tag but i didnt fixed it
    i tried to put functions on main script and damage script but it didnt work, did i made something wrong on these scripts

heres the damage script

local hitevent = script.Parent.Fire
local damage = require(script.Parent.ModuleScript)["damage"]
function TagHumanoid(humanoid, player)
	local Creator_Tag = Instance.new("ObjectValue")
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	game.Debris:AddItem(Creator_Tag, 2)
	Creator_Tag.Parent = humanoid
end

local function dmgHuman(player,target)
	local targetplayer = nil
	for _, beano in pairs(game:GetService("Players"):GetChildren()) do
		if beano.Name == target.Parent.Name then
			targetplayer = beano
			break
		end
	end
	if targetplayer then
		if targetplayer.Team ~= player.Team then
			TagHumanoid(targetplayer,player)
			local tag = Instance.new("ObjectValue")
			tag.Value = player
			tag.Parent = target
			target.Health = target.Health - damage
		end
	else
		local tag = Instance.new("ObjectValue")
		tag.Value = player
		tag.Parent = target

		target.Health = target.Health - damage
	end

end

hitevent.OnServerEvent:Connect(dmgHuman)
hitevent.OnServerEvent:Connect(dmgHuman)
hitevent.OnServerEvent:Connect(dmgHuman)

how do i fix this problem?

Does your script throw an error? And why are you doing hitevent.OnServerEvent:Connect(dmgHuman) 3 times?

No my script doesnt throw an error, but the creator tag doesnt work, i want to make creator tag work properly

Never mind i fixed it myself

i rescripted whole gun

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.