local chatFrame = script.Parent.Frame plr = game.Players.LocalPlayer -- Bind function to update from server game.ReplicatedStorage.SendMessages.OnClientEvent:connect(function(messages) -- Clear all of the current messages chatFrame:ClearAllChildren() -- Create TextLabel for every message for i, message in pairs(messages) do if plr.Name == "docrobloxman52" then local newLine = Instance.new("TextLabel", chatFrame) newLine.Text = "[DEV] "..message newLine.TextColor = BrickColor.new(255,0,0) newLine.Size = UDim2.new(1,0,0,18) newLine.Position = UDim2.new(0,0,0,18*(i-1)) newLine.TextXAlignment = Enum.TextXAlignment.Left newLine.TextYAlignment = Enum.TextYAlignment.Center newLine.BackgroundTransparency = 1 newLine.BorderSizePixel = 0 newLine.TextStrokeTransparency = 0.5 newLine.FontSize = Enum.FontSize.Size18 newLine.Font = Enum.Font.SourceSansBold elseif plr.Name ~= "docrobloxman52" then local newLine = Instance.new("TextLabel", chatFrame) newLine.Text = message newLine.TextColor = BrickColor.new(255,255,255) newLine.Size = UDim2.new(1,0,0,18) newLine.Position = UDim2.new(0,0,0,18*(i-1)) newLine.TextXAlignment = Enum.TextXAlignment.Left newLine.TextYAlignment = Enum.TextYAlignment.Center newLine.BackgroundTransparency = 1 newLine.TextStrokeTransparency = 0.5 newLine.BorderSizePixel = 0 newLine.FontSize = Enum.FontSize.Size18 newLine.Font = Enum.Font.SourceSansBold end end end)
This is my script and when I tried it out, everyone that spoke had [DEV] next to their name. This is a problem. Can you help? Also it is in a local script
plr is the LocalPlayer, aka the player with the chat GUI, NOT the player saying the message. Therefore, ATM your script is giving the tag to every message for docrobloxman32 alone. To fix this, you'll need to send the players who said the messages when you run FireClient on game.ReplicatedStorage.SendMessages so you can check these, possibly each value in the messages table being a table themself ({Player=....,Message="...."}).