Alright, I turned bubble chat on, made it black color, and then I put script inside of ServerScriptService with the idea of making chat tags. I made the script, but it gave me error and I was wondering if it could be because of the bubble chat or is it completely different reason..Help me please.
Also, the script:
01 | local ServerScriptService = game:GetService( "ServerScriptService" ) |
02 | local ChatService = require(ServerScriptService:WaitForChild( "ChatServiceRunner" ):WaitForChild( "ChatService" )) |
03 | local Players = game:GetService( "Players" ) |
04 |
05 | local Admins = ( 'lmao1717' ) |
06 |
07 | ChatService.SpeakerAdded:Connect ( function (PlrName) |
08 | local Speaker = ChatService:GetSpeaker(PlrName) |
09 | for _,v in pairs (Admins) do |
10 | if Players [ PlrName ] .Name = = v then |
11 | Speaker:SexExtraData( 'Tags' , { { TagText = "Manager" , TagColor = Color 3. fromRGB( 255 , 255 , 255 ) } } ) |
12 | end |
13 | end |
14 | end ) |
I found 2 problems First, you need to change the "()" to "{}" to make it into a table
1 | local Admins = { 'lmao1717' } |
Second
1 | Speaker:SexExtraData( 'Tags' , { { TagText = "Manager" |
I dont think you meant to type "SexExtraData" but intead "SetExtraData"
The problems seems to be that your Admins
value isn't a table, but a string. The for loop wont work because of this.
You can make it a table by replacing the parentheses with curly brackets.
01 | local ServerScriptService = game:GetService( "ServerScriptService" ) |
02 | local ChatService = require(ServerScriptService:WaitForChild( "ChatServiceRunner" ):WaitForChild( "ChatService" )) |
03 | local Players = game:GetService( "Players" ) |
04 |
05 | local Admins = { 'lmao1717' } |
06 |
07 | ChatService.SpeakerAdded:Connect ( function (PlrName) |
08 | local Speaker = ChatService:GetSpeaker(PlrName) |
09 | for _,v in pairs (Admins) do |
10 | if Players [ PlrName ] .Name = = v then |
11 | Speaker:SexExtraData( 'Tags' , { { TagText = "Manager" , TagColor = Color 3. fromRGB( 255 , 255 , 255 ) } } ) |
12 | end |
13 | end |
14 | end ) |
I found 2 problems First, you need to change the "()" to "{}" to make it into a table
view source
1 local Admins = {'lmao1717'} Second
view source
1 Speaker:SexExtraData('Tags', {{TagText = "Manager" I dont think you meant to type "SexExtraData" but intead "SetExtraData"