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
