A ServerScript will detect if RPName.TextLabel(called Name) matches player.Name.
If it matches it will add a Tag to the Chat.
If not, nothing will happen.
local ChatService = require(game:GetService(“ServerScriptService”):WaitForChild(“ChatServiceRunner”):WaitForChild(“ChatService”))
local Speaker = ChatService:GetSpeaker(player)
local character = player.Character
local function xa()
while wait(1) do
if player.Name == character.Head.RPName:FindFirstChild(“Name”).Text then
putting the new line above, now nothing will be read below line 6.
I was supposed to print “finish” but nothing happens.
It was also supposed to give an error that the RPName does not exist but nothing happens in the output either
SpeakerAdded returns the speakername (playername), not the player instance.
You can use Speaker:GetPlayer(), example:
local ChatService = require(ChatServiceModuleLocation)
local function SpeakerAdded
local Speaker = ChatService:GetSpeaker(SpeakerName)
local Player = Speaker:GetPlayer()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Head = Character.Head
local GetSpeakers = ChatService:GetSpeakerList()
for i = 1, (#GetSpeakers)