-- MIN CHAT (Fixed Text Overflow & Multi-Line Wrapping Issue)
local CoreGui = game:GetService("CoreGui")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
-- Custom Variables
local CustomDisplayName = LocalPlayer.Name
local CustomTag = "" -- Secret Tag variable
-- Fixed RP Name & Bio Set Function (Normal RP Name)
local function applyRP()
local username = LocalPlayer.Name
local normalName = 'xMIN_CHATx'
local redBio = '' .. username .. ''
local RE = ReplicatedStorage:FindFirstChild("RE") or ReplicatedStorage:FindFirstChild("Remotes")
if RE then
local nameRemote = RE:FindFirstChild("1RPNam1eTex1t") or RE:FindFirstChild("RPNameText") or RE:FindFirstChild("1RPNameText")
local bioRemote = RE:FindFirstChild("1RPBi1oTex1t") or RE:FindFirstChild("RPBioText") or RE:FindFirstChild("1RPBioText")
if nameRemote then
pcall(function() nameRemote:FireServer("RolePlayName", normalName) end)
pcall(function() nameRemote:FireServer(normalName) end)
end
if bioRemote then
pcall(function() bioRemote:FireServer("RolePlayBio", redBio) end)
pcall(function() bioRemote:FireServer(redBio) end)
end
end
local char = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
if char then
local bioVal = char:FindFirstChild("RPBio") or char:FindFirstChild("Bio")
if bioVal and bioVal:IsA("StringValue") then pcall(function() bioVal.Value = redBio end) end
local nameVal = char:FindFirstChild("RPName") or char:FindFirstChild("Name")
if nameVal and nameVal:IsA("StringValue") then pcall(function() nameVal.Value = normalName end) end
end
end
-- Run RP Auto-Set on Spawn
task.spawn(function()
task.wait(1.5)
applyRP()
LocalPlayer.CharacterAdded:Connect(function()
task.wait(1.5)
applyRP()
end)
end)
-- Network Event Setup
local ChatEvent = ReplicatedStorage:FindFirstChild("MinChatNetwork")
if not ChatEvent then
ChatEvent = Instance.new("BindableEvent")
ChatEvent.Name = "MinChatNetwork"
ChatEvent.Parent = ReplicatedStorage
end
-- Screen UI Setup
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "MinChatGui"
ScreenGui.Parent = CoreGui
-- Title Bar
local TitleBar = Instance.new("Frame")
TitleBar.Size = UDim2.new(0, 110, 0, 25)
TitleBar.Position = UDim2.new(0.02, 0, 0.4, -30)
TitleBar.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
TitleBar.BackgroundTransparency = 0.2
TitleBar.BorderSizePixel = 0
TitleBar.Parent = ScreenGui
local TitleText = Instance.new("TextLabel")
TitleText.Size = UDim2.new(1, 0, 1, 0)
TitleText.BackgroundTransparency = 1
TitleText.Text = "MIN CHAT"
TitleText.TextColor3 = Color3.fromRGB(255, 255, 255)
TitleText.Font = Enum.Font.SourceSansBold
TitleText.TextSize = 14
TitleText.Parent = TitleBar
-- Toggle Button
local ToggleBtn = Instance.new("TextButton")
ToggleBtn.Size = UDim2.new(0, 110, 0, 25)
ToggleBtn.Position = UDim2.new(0.02, 0, 0.4, 0)
ToggleBtn.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
ToggleBtn.BackgroundTransparency = 0.3
ToggleBtn.BorderSizePixel = 0
ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleBtn.Text = "Toggle Chat"
ToggleBtn.Font = Enum.Font.SourceSansSemibold
ToggleBtn.TextSize = 14
ToggleBtn.Parent = ScreenGui
-- Main Chat Frame
local MainFrame = Instance.new("Frame")
MainFrame.Size = UDim2.new(0, 380, 0, 260)
MainFrame.Position = UDim2.new(0.5, -190, 0.5, -130)
MainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
MainFrame.BackgroundTransparency = 0.4
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Draggable = true
MainFrame.ClipsDescendants = true
MainFrame.Parent = ScreenGui
-- Scroll Message Box
local ScrollBox = Instance.new("ScrollingFrame")
ScrollBox.Size = UDim2.new(1, -10, 1, -45)
ScrollBox.Position = UDim2.new(0, 5, 0, 5)
ScrollBox.BackgroundTransparency = 1
ScrollBox.CanvasSize = UDim2.new(0, 0, 0, 0)
ScrollBox.ClipsDescendants = true
ScrollBox.ScrollBarThickness = 6
ScrollBox.Parent = MainFrame
local UIListLayout = Instance.new("UIListLayout")
UIListLayout.Parent = ScrollBox
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0, 4)
-- Input Text Box
local TextBox = Instance.new("TextBox")
TextBox.Size = UDim2.new(1, -10, 0, 30)
TextBox.Position = UDim2.new(0, 5, 1, -35)
TextBox.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
TextBox.BackgroundTransparency = 0.3
TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
TextBox.PlaceholderText = "Type message or click username to PM..."
TextBox.Text = ""
TextBox.ClearTextOnFocus = false
TextBox.TextWrapped = true
TextBox.Parent = MainFrame
-- Toggle Visibility
ToggleBtn.MouseButton1Click:Connect(function()
MainFrame.Visible = not MainFrame.Visible
end)
-- Table to store references to active Animated Tags/Names
local RainbowTagsList = {}
-- Message Render Function
local function AddMessage(senderPlayer, msg, isSystem, overrideName, overrideTag, isPrivate, recipientName)
local MessageRow = Instance.new("Frame")
MessageRow.Size = UDim2.new(1, 0, 0, 0)
MessageRow.AutomaticSize = Enum.AutomaticSize.Y
MessageRow.BackgroundTransparency = 1
MessageRow.ClipsDescendants = true
MessageRow.Parent = ScrollBox
local AvatarImg = Instance.new("ImageLabel")
AvatarImg.Size = UDim2.new(0, 24, 0, 24)
AvatarImg.Position = UDim2.new(0, 2, 0, 2)
AvatarImg.BackgroundTransparency = 1
if not isSystem and senderPlayer then
task.spawn(function()
local content, isReady = Players:GetUserThumbnailAsync(senderPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
if isReady then AvatarImg.Image = content end
end)
end
AvatarImg.Parent = MessageRow
local senderRealName = senderPlayer and senderPlayer.Name or overrideName or "Unknown"
-- Founder & Leader Identification
local isFounder = (senderRealName:lower() == "minown_aditya" or senderRealName:lower() == "xmin_adityax")
local isLeader = (senderRealName:lower() == "leaderusername") -- Yahan Leader ka Username daalein
if isSystem then
local SysLabel = Instance.new("TextLabel")
SysLabel.Size = UDim2.new(1, -32, 0, 0)
SysLabel.Position = UDim2.new(0, 30, 0, 2)
SysLabel.AutomaticSize = Enum.AutomaticSize.Y
SysLabel.BackgroundTransparency = 1
SysLabel.TextXAlignment = Enum.TextXAlignment.Left
SysLabel.TextColor3 = Color3.fromRGB(255, 215, 0)
SysLabel.Text = msg
SysLabel.Font = Enum.Font.SourceSansBold
SysLabel.TextSize = 14
SysLabel.TextWrapped = true
SysLabel.Parent = MessageRow
else
local CombinedLabel = Instance.new("TextLabel")
CombinedLabel.Size = UDim2.new(1, -35, 0, 0)
CombinedLabel.Position = UDim2.new(0, 30, 0, 2)
CombinedLabel.AutomaticSize = Enum.AutomaticSize.Y
CombinedLabel.BackgroundTransparency = 1
CombinedLabel.TextXAlignment = Enum.TextXAlignment.Left
CombinedLabel.Font = Enum.Font.SourceSans
CombinedLabel.TextSize = 14
CombinedLabel.RichText = true
CombinedLabel.TextWrapped = true
local displayName = overrideName or senderRealName
if isPrivate then
CombinedLabel.TextColor3 = Color3.fromRGB(255, 120, 255)
local prefix = (senderPlayer == LocalPlayer) and ("[PM to " .. (recipientName or "Unknown") .. "]: ") or ("[PM from " .. senderRealName .. "]: ")
table.insert(RainbowTagsList, {
LabelObj = CombinedLabel,
TagName = overrideTag or "",
DisplayName = displayName,
Message = msg,
IsFounder = isFounder,
IsLeader = isLeader,
IsPM = true,
CustomPrefix = prefix
})
else
CombinedLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
table.insert(RainbowTagsList, {
LabelObj = CombinedLabel,
TagName = overrideTag or "",
DisplayName = displayName,
Message = msg,
IsFounder = isFounder,
IsLeader = isLeader,
IsPM = false,
CustomPrefix = ""
})
end
CombinedLabel.Parent = MessageRow
-- Click to PM
if senderPlayer and senderPlayer ~= LocalPlayer then
local ClickBtn = Instance.new("TextButton")
ClickBtn.Size = UDim2.new(1, 0, 1, 0)
ClickBtn.BackgroundTransparency = 1
ClickBtn.Text = ""
ClickBtn.Parent = CombinedLabel
ClickBtn.MouseButton1Click:Connect(function()
TextBox.Text = "/pm " .. senderRealName .. " "
TextBox:CaptureFocus()
end)
end
end
task.defer(function()
ScrollBox.CanvasSize = UDim2.new(0, 0, 0, UIListLayout.AbsoluteContentSize.Y + 10)
ScrollBox.CanvasPosition = Vector2.new(0, ScrollBox.AbsoluteCanvasSize.Y)
end)
end
-- Red-Black-White RGB Cycle (For FOUNDER & LEADER Badges)
local function GetRedBlackWhiteColor(t)
t = t % 3
if t < 1 then
return Color3.new(1 - t, 0, 0)
elseif t < 2 then
local v = t - 1
return Color3.new(v, v, v)
else
local v = t - 2
return Color3.new(1, 1 - v, 1 - v)
end
end
-- Blue-Green-Red-Purple RGB Cycle (For Custom Tag)
local function GetBlueGreenRedPurpleColor(t)
t = t % 4
if t < 1 then
return Color3.new(0, t, 1 - t)
elseif t < 2 then
local v = t - 1
return Color3.new(v, 1 - v, 0)
elseif t < 3 then
local v = t - 2
return Color3.new(1 - (0.5 * v), 0, 0.5 * v)
else
local v = t - 3
return Color3.new(0.5 * (1 - v), 0, 0.5 + (0.5 * v))
end
end
-- Live Color Cycling Loop
RunService.RenderStepped:Connect(function()
local t = tick() * 1.5
local tagColor = GetBlueGreenRedPurpleColor(t)
local r1, g1, b1 = math.floor(tagColor.R * 255), math.floor(tagColor.G * 255), math.floor(tagColor.B * 255)
local rbwColor = GetRedBlackWhiteColor(t)
local r2, g2, b2 = math.floor(rbwColor.R * 255), math.floor(rbwColor.G * 255), math.floor(rbwColor.B * 255)
for _, tagData in ipairs(RainbowTagsList) do
if tagData.LabelObj and tagData.LabelObj.Parent then
local prefix = tagData.CustomPrefix or ""
local formattedBadge = ""
local formattedTag = ""
local formattedName = ""
-- FOUNDER / LEADER Badge (Red-Black-White RGB)
if tagData.IsFounder then
formattedBadge = string.format('[FOUNDER] ', r2, g2, b2)
elseif tagData.IsLeader then
formattedBadge = string.format('[LEADER] ', r2, g2, b2)
end
-- Custom Tag (Blue-Green-Red-Purple RGB)
if tagData.TagName and tagData.TagName ~= "" then
formattedTag = string.format('[%s] ', r1, g1, b1, tagData.TagName)
end
-- Normal White Display Name in Parentheses ()
formattedName = string.format('(%s): ', tagData.DisplayName)
if tagData.IsPM then
tagData.LabelObj.Text = prefix .. formattedBadge .. formattedTag .. tagData.Message
else
tagData.LabelObj.Text = prefix .. formattedBadge .. formattedTag .. formattedName .. tagData.Message
end
end
end
end)
-- Special Welcome Messages
task.spawn(function()
task.wait(0.5)
local username = LocalPlayer.Name:lower()
if username == "minown_aditya" or username == "xmin_adityax" then
AddMessage(nil, "[FOUNDER ADITYA] WELCOME BACK BOSS " .. LocalPlayer.Name, true)
elseif username == "leaderusername" then -- Yahan Leader ka Username daalein
AddMessage(nil, "[LEADER] WELCOME " .. LocalPlayer.Name, true)
else
AddMessage(nil, "WELCOME " .. LocalPlayer.Name, true)
end
end)
-- Find Target Player Helper
local function GetPlayerByName(name)
name = name:lower()
for _, p in ipairs(Players:GetPlayers()) do
if p.Name:lower():sub(1, #name) == name or p.DisplayName:lower():sub(1, #name) == name then
return p
end
end
return nil
end
-- Send Message & Secret Commands Logic
TextBox.FocusLost:Connect(function(enterPressed)
if enterPressed and TextBox.Text ~= "" then
local textToSend = TextBox.Text
TextBox.Text = ""
local cleanText = textToSend:lower():gsub("%s+", "")
-- Secret /pm Command
if textToSend:sub(1, 4):lower() == "/pm " or textToSend:sub(1, 3):lower() == "/w " then
local args = string.split(textToSend, " ")
local targetName = args[2]
local pmMsg = table.concat(args, " ", 3)
if targetName and pmMsg and pmMsg ~= "" then
local targetPlayer = GetPlayerByName(targetName)
if targetPlayer then
AddMessage(LocalPlayer, pmMsg, false, CustomDisplayName, CustomTag, true, targetPlayer.Name)
ChatEvent:Fire(LocalPlayer, pmMsg, CustomDisplayName, CustomTag, true, targetPlayer.Name)
else
AddMessage(nil, "Player not found!", true)
end
end
-- Secret /name Command
elseif textToSend:sub(1, 6):lower() == "/name " then
local newName = textToSend:sub(7)
if newName and newName:gsub("%s+", "") ~= "" then
CustomDisplayName = newName
end
elseif cleanText == "/namereset" or cleanText == "/nameremove" then
CustomDisplayName = LocalPlayer.Name
-- Secret /tag Command (Tag Remove Options Included)
elseif cleanText == "/tag" or cleanText == "/tagreset" or cleanText == "/tagclear" or cleanText == "/tagremove" then
CustomTag = ""
AddMessage(nil, "Tag removed!", true)
elseif textToSend:sub(1, 5):lower() == "/tag " then
local newTag = textToSend:sub(6)
if newTag and newTag:gsub("%s+", "") ~= "" then
CustomTag = newTag
end
else
-- Normal Message Send
AddMessage(LocalPlayer, textToSend, false, CustomDisplayName, CustomTag, false)
ChatEvent:Fire(LocalPlayer, textToSend, CustomDisplayName, CustomTag, false)
end
end
end)
ChatEvent.Event:Connect(function(senderPlayer, msg, senderCustomName, senderCustomTag, isPrivate, recipientName)
if senderPlayer ~= LocalPlayer then
if isPrivate then
if recipientName and recipientName:lower() == LocalPlayer.Name:lower() then
AddMessage(senderPlayer, msg, false, senderCustomName, senderCustomTag, true, LocalPlayer.Name)
end
else
AddMessage(senderPlayer, msg, false, senderCustomName, senderCustomTag, false)
end
end
end)