Hello,
So I have a problem here, I made so that when my attack hits the mob, it creates a "creator’ value in his humanoid.
The creator value does get created, but it doesn’t set it’s value to the player’s name.
script.Parent.Touched:Connect(function(hit)
local Player = game.Players:GetPlayerFromCharacter(Character)
local 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 UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
Humanoid:TakeDamage(DefaultDamage)
UntagHumanoid(Humanoid)
TagHumanoid(Humanoid, Player)
![]()
^
That doesn’t work
Any Help is appreciated!