the title is very clear. I call a function when a character is added(I checked it with debugging tools, it does get called) however, it doesn’t do anything.
local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local function addTag(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local humrootpart = char:WaitForChild("HumanoidRootPart")
CollectionService:AddTag(humrootpart, "Egg")
print(CollectionService:GetTags(humrootpart))
end
Players.PlayerAdded:Connect(function(plr)
plr:LoadCharacter()
addTag(plr)
end)
local CollectionService = game:GetService("CollectionService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local function addTag(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local humrootpart = char:WaitForChild("HumanoidRootPart")
CollectionService:AddTag(humrootpart, "Egg")
print(CollectionService:GetTags(humrootpart))
end
LocalPlayer:LoadCharacter()
addTag(LocalPlayer)
script runs when the player joins because it is a local script