I'm working on a game where if you pull out your weapon, soldiers will automatically attack you. I'm using the Roblox Free Model: Rthro Soldier. So after evaluating the scripts, it listed that it will attack based on if a player has the tag "SoldierEnemy". Here's what I have so far.

local Tool = script.Parent
local CollectionService = game:GetService("CollectionService")
local player = game.Players.LocalPlayer

Tool.Equipped:Connect(function(mouse)
	print("ToolEquip")
	CollectionService:AddTag(player, "SoldierEnemy")
end)

This is a localscript within the gun. If anyone could clear up the problem, that would be greatly appreciated!