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
8 years ago
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?

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 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

Ad

Answer this question