Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help With Userdata Values?

for _, player in pairs(game.Players:GetPlayers()) do
		local teamthing = player.TeamColor
		local sanitizedMessage = teamthing .. sender .. ": " .. game.Chat:FilterStringForPlayerAsync(message, player)
		local playerMessages = messageData[tostring(player.userId)]

I'm making a custom chat system and I want the Player's TeamColor to go before the Player's name, but it always has issues with TeamColor being a Userdata value or something and it breaks the script. Some help with this please?

1 comment

0

If I understand what you're saying, "teamthing" is a UserData Value and in order to make it appear in the message as a string just simply put it inside of tostring().

1 answer

✓ Accepted answer

Hi Scoota! Your variable teamthing can be converted to a string via the method tostring().

This discussion is preserved as it was. New answers, comments, and votes are closed.