Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help With Userdata Values?

Asked by
Scootakip 299 Moderation Voter
9 years ago
1for _, player in pairs(game.Players:GetPlayers()) do
2        local teamthing = player.TeamColor
3        local sanitizedMessage = teamthing .. sender .. ": " .. game.Chat:FilterStringForPlayerAsync(message, player)
4        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?

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(). FearMeIAmLag 1161 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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

Ad

Answer this question