I’m having a problem with AddTag of CollectionService, when i use it the tag dont appear and don’t work the rest of the script.
collection = game:GetService("CollectionService")
game.Players.PlayerAdded:Connect(function(playerr)
playerr.CharacterAdded:Connect(function(char)
for i, v in pairs(char:GetDescendants()) do
if v:IsA("Humanoid") then
print("go")
collection:AddTag(v, "KillNoobs") -- Problem: not adding the tag "KillNoobs"
local taketag = collection:GetTagged("KillNoobs")
if collection:HasTag("KillNoobs") then
repeat
wait(1.5)
taketag:TakeDamage(10)
print("Hit")
until taketag.health < 20
end
end
end
end)
end)
Please help me ;(