-- CONFIGURATION local VERIFIED_USER_ID = 12345678 -- 🔁 Replace by your roblox id -- SERVICES local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local StarterGui = game:GetService("StarterGui") -- 🔧 Créer RemoteEvent s'il n'existe pas local eventName = "CustomChatEvent" local chatEvent = ReplicatedStorage:FindFirstChild(eventName) if not chatEvent then chatEvent = Instance.new("RemoteEvent") chatEvent.Name = eventName chatEvent.Parent = ReplicatedStorage end -- 🖼️ Créer GUI dans StarterGui s'il n'existe pas local guiName = "CustomChatGui" local existingGui = StarterGui:FindFirstChild(guiName) if not existingGui then local screenGui = Instance.new("ScreenGui") screenGui.Name = guiName screenGui.ResetOnSpawn = false local chatFrame = Instance.new("ScrollingFrame") chatFrame.Name = "ChatFrame" chatFrame.Size = UDim2.new(0, 400, 0, 250) chatFrame.Position = UDim2.new(0, 20, 1, -270) chatFrame.CanvasSize = UDim2.new(0, 0, 5, 0) chatFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20) chatFrame.BorderSizePixel = 0 chatFrame.ScrollBarThickness = 6 chatFrame.Parent = screenGui screenGui.Parent = StarterGui end -- 📜 Code client injecté automatiquement local function createClientScript() local scriptSource = [[ local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local localPlayer = Players.LocalPlayer local playerGui = localPlayer:WaitForChild("PlayerGui") local chatGui = playerGui:WaitForChild("CustomChatGui") local chatFrame = chatGui:WaitForChild("ChatFrame") local VERIFIED_USER_ID = ]] .. VERIFIED_USER_ID .. [[ local onMessage = ReplicatedStorage:WaitForChild("CustomChatEvent") onMessage.OnClientEvent:Connect(function(senderName, senderUserId, message) local label = Instance.new("TextLabel") label.Size = UDim2.new(1, 0, 0, 24) label.BackgroundTransparency = 1 label.TextXAlignment = Enum.TextXAlignment.Left label.Font = Enum.Font.Gotham label.TextSize = 16 label.TextWrapped = true label.RichText = true if senderUserId == VERIFIED_USER_ID then label.Text = "[✓] " .. senderName .. ": " .. message else label.Text = senderName .. ": " .. message label.TextColor3 = Color3.fromRGB(255, 255, 255) end label.Parent = chatFrame chatFrame.CanvasPosition = Vector2.new(0, chatFrame.CanvasSize.Y.Offset) end) ]] return scriptSource end -- Injecter le client script à chaque joueur Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(msg) chatEvent:FireAllClients(player.DisplayName, player.UserId, msg) end) player.CharacterAdded:Connect(function() local starterScript = player:WaitForChild("PlayerGui") local localScript = Instance.new("LocalScript") localScript.Name = "ChatClient" localScript.Source = createClientScript() localScript.Parent = starterScript end) end)