Hello, I need to do a chat command that renders the players, I have this code, is it well done?
And how can I do so that when the player leaves the game and returns they still having this new name?
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(message)
-- Rename Player
if Player.TeamColor == BrickColor.new("Lapis") then
for i,Player2 in pairs(Players:GetPlayers()) do
local msg2 = ""
if message == '.Rename ' .. Player2.Name .. msg2 then
print("The player name is ..." .. Player2.Name)
Player2.Name = msg2
end
end
end
end)
end)