Hello everyone,
I’m making a chat tag system for my game using the roblox chat API. However, when I get the speaker object of the player it sometimes returns nil and sometimes doesn’t.
function TagsFunctions:EquipTag(PlayerName,Tag)
local Player = PlayerService:FindFirstChild(PlayerName)
local PlayerData = SavedPlayerDataManager.Profiles[Player]
if PlayerData then
local Table = TagsFunctions:GetEquippedTags(PlayerName)
local Speaker
for i,v in ipairs(ChatService:GetSpeakerList()) do
if v == PlayerName then
Speaker = ChatService:GetSpeaker(PlayerName)
end
end
end
I’ve also tried directly get the speaker without the loop but that still didn’t work. Any one knows what’s the problem?
Thank you.