XaNax chat project [ No Verify age ]
Key RequiredUniversal

XaNax chat project [ No Verify age ]

Universal Scriptsaiwyagarnida79saiwyagarnida79 662 views 1.1K executesUpdated Sep 12, 2026
Unrated
00
Lua Script•516 lines (18384 chars)
-- [[ XANAX CHAT BY CLASH TEAM EMBEGEHT_T ]] --
-- Owner: acc2xiandi_mri
-- Welcome/Goodbye cuma buat yang PAKE SCRIPT
-- Notifikasi atas layar pas ada yang chat

local Players = game:GetService("Players")
local LP = Players.LocalPlayer
local CoreGui = game:GetService("CoreGui")
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

-- ============================================================================
-- [[ KONFIGURASI OWNER & ADMIN ]]
-- ============================================================================
local OWNER_LIST = {
    ["acc2xiandi_mri"] = true,
    ["ClashTeamEmbegehtT"] = true,
    ["EmbegehtT"] = true,
}

local ADMIN_LIST = {
    ["Admin1"] = true,
    ["Admin2"] = true,
}

-- ============================================================================
-- [[ DETEKSI PLAYER YANG PAKE SCRIPT ]]
-- ============================================================================
local scriptUsers = {}

local function isScriptUser(player)
    local attr = player:GetAttribute("XaNaxChatUser")
    if attr == true then return true end
    if OWNER_LIST[player.Name] or ADMIN_LIST[player.Name] then return true end
    if scriptUsers[player.Name] then return true end
    return false
end

pcall(function() LP:SetAttribute("XaNaxChatUser", true) end)

task.spawn(function()
    task.wait(1)
    for _, p in ipairs(Players:GetPlayers()) do
        pcall(function()
            if p:GetAttribute("XaNaxChatUser") == true then
                scriptUsers[p.Name] = true
            end
        end)
    end
end)

-- ============================================================================
-- [[ HAPUS GUI LAMA ]]
-- ============================================================================
if CoreGui:FindFirstChild("XaNaxChat") then
    CoreGui.XaNaxChat:Destroy()
end
if CoreGui:FindFirstChild("XaNaxNotif") then
    CoreGui.XaNaxNotif:Destroy()
end

-- ============================================================================
-- [[ UI UTAMA ]]
-- ============================================================================
local gui = Instance.new("ScreenGui")
gui.Name = "XaNaxChat"
gui.ResetOnSpawn = false
gui.Parent = CoreGui
gui.IgnoreGuiInset = true

local main = Instance.new("Frame", gui)
main.Name = "ChatFrame"
main.Size = UDim2.new(0, 340, 0, 280)
main.Position = UDim2.new(0.02, 0, 0.6, 0)
main.BackgroundColor3 = Color3.fromRGB(10, 0, 0)
main.BackgroundTransparency = 0.15
main.BorderSizePixel = 0
main.Active = true
main.Draggable = true
Instance.new("UICorner", main).CornerRadius = UDim.new(0, 10)

local stroke = Instance.new("UIStroke", main)
stroke.Thickness = 2
stroke.Color = Color3.fromRGB(255, 30, 30)
stroke.Transparency = 0.3

local header = Instance.new("Frame", main)
header.Size = UDim2.new(1, 0, 0, 32)
header.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
header.BorderSizePixel = 0
Instance.new("UICorner", header).CornerRadius = UDim.new(0, 10)

local title = Instance.new("TextLabel", header)
title.Size = UDim2.new(1, -10, 1, 0)
title.Position = UDim2.new(0, 8, 0, 0)
title.BackgroundTransparency = 1
title.Text = "🌐 XaNax Chat"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.Font = Enum.Font.GothamBold
title.TextSize = 14
title.TextXAlignment = Enum.TextXAlignment.Left

local chatScroll = Instance.new("ScrollingFrame", main)
chatScroll.Name = "ChatScroll"
chatScroll.Size = UDim2.new(1, -8, 1, -80)
chatScroll.Position = UDim2.new(0, 4, 0, 36)
chatScroll.BackgroundTransparency = 1
chatScroll.ScrollBarThickness = 4
chatScroll.ScrollBarImageColor3 = Color3.fromRGB(255, 30, 30)
chatScroll.CanvasSize = UDim2.new(0, 0, 0, 0)
chatScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y

local chatLayout = Instance.new("UIListLayout", chatScroll)
chatLayout.Padding = UDim.new(0, 5)
chatLayout.SortOrder = Enum.SortOrder.LayoutOrder

local inputFrame = Instance.new("Frame", main)
inputFrame.Size = UDim2.new(1, -8, 0, 36)
inputFrame.Position = UDim2.new(0, 4, 1, -40)
inputFrame.BackgroundColor3 = Color3.fromRGB(20, 0, 0)
inputFrame.BorderSizePixel = 0
Instance.new("UICorner", inputFrame).CornerRadius = UDim.new(0, 8)

local inputBox = Instance.new("TextBox", inputFrame)
inputBox.Size = UDim2.new(1, -50, 1, 0)
inputBox.Position = UDim2.new(0, 5, 0, 0)
inputBox.BackgroundTransparency = 1
inputBox.Text = ""
inputBox.PlaceholderText = "Ketik chat..."
inputBox.PlaceholderColor3 = Color3.fromRGB(100, 100, 100)
inputBox.TextColor3 = Color3.fromRGB(255, 255, 255)
inputBox.Font = Enum.Font.Gotham
inputBox.TextSize = 12
inputBox.TextXAlignment = Enum.TextXAlignment.Left
inputBox.ClearTextOnFocus = false

local sendBtn = Instance.new("TextButton", inputFrame)
sendBtn.Size = UDim2.new(0, 40, 1, 0)
sendBtn.Position = UDim2.new(1, -44, 0, 0)
sendBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
sendBtn.Text = "→"
sendBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
sendBtn.Font = Enum.Font.GothamBold
sendBtn.TextSize = 20
sendBtn.BorderSizePixel = 0
Instance.new("UICorner", sendBtn).CornerRadius = UDim.new(0, 8)

sendBtn.MouseEnter:Connect(function()
    sendBtn.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
end)
sendBtn.MouseLeave:Connect(function()
    sendBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0)
end)

local hideBtn = Instance.new("TextButton", gui)
hideBtn.Name = "HideBtn"
hideBtn.Size = UDim2.new(0, 45, 0, 45)
hideBtn.Position = UDim2.new(0.02, 0, 0.6, -50)
hideBtn.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
hideBtn.Text = "💬"
hideBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
hideBtn.Font = Enum.Font.GothamBold
hideBtn.TextSize = 22
hideBtn.BorderSizePixel = 0
hideBtn.Active = true
hideBtn.Draggable = true
Instance.new("UICorner", hideBtn).CornerRadius = UDim.new(1, 0)

local hideStroke = Instance.new("UIStroke", hideBtn)
hideStroke.Thickness = 2
hideStroke.Color = Color3.fromRGB(255, 100, 100)

-- ============================================================================
-- [[ UI NOTIFIKASI ATAS LAYAR ]]
-- ============================================================================
local notifGui = Instance.new("ScreenGui")
notifGui.Name = "XaNaxNotif"
notifGui.ResetOnSpawn = false
notifGui.Parent = CoreGui
notifGui.IgnoreGuiInset = true

local notifContainer = Instance.new("Frame", notifGui)
notifContainer.Name = "NotifContainer"
notifContainer.Size = UDim2.new(0, 350, 0, 0)
notifContainer.Position = UDim2.new(0.5, -175, 0, 10)
notifContainer.BackgroundTransparency = 1
notifContainer.AutomaticSize = Enum.AutomaticSize.Y

local notifLayout = Instance.new("UIListLayout", notifContainer)
notifLayout.Padding = UDim.new(0, 5)
notifLayout.SortOrder = Enum.SortOrder.LayoutOrder
notifLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center

-- Fungsi bikin notifikasi
local function showNotification(playerName, message)
    local tag = getPlayerTag(playerName)
    local displayName = tag and (tag .. " " .. playerName) or playerName
    
    -- Frame notif
    local notif = Instance.new("Frame", notifContainer)
    notif.Size = UDim2.new(0, 350, 0, 55)
    notif.BackgroundColor3 = Color3.fromRGB(15, 0, 0)
    notif.BackgroundTransparency = 0.1
    notif.BorderSizePixel = 0
    notif.AutomaticSize = Enum.AutomaticSize.X
    Instance.new("UICorner", notif).CornerRadius = UDim.new(0, 8)
    
    local nStroke = Instance.new("UIStroke", notif)
    nStroke.Thickness = 2
    nStroke.Color = Color3.fromRGB(255, 30, 30)
    
    -- Avatar
    local avatar = Instance.new("ImageLabel", notif)
    avatar.Size = UDim2.new(0, 40, 0, 40)
    avatar.Position = UDim2.new(0, 8, 0, 7)
    avatar.BackgroundColor3 = Color3.fromRGB(40, 0, 0)
    avatar.BorderSizePixel = 0
    avatar.Image = getAvatar(playerName)
    Instance.new("UICorner", avatar).CornerRadius = UDim.new(1, 0)
    
    local avStroke = Instance.new("UIStroke", avatar)
    avStroke.Thickness = 1.5
    avStroke.Color = getTagColor(playerName)
    
    -- Username
    local nameLabel = Instance.new("TextLabel", notif)
    nameLabel.Size = UDim2.new(1, -60, 0, 18)
    nameLabel.Position = UDim2.new(0, 55, 0, 7)
    nameLabel.BackgroundTransparency = 1
    nameLabel.TextXAlignment = Enum.TextXAlignment.Left
    nameLabel.Font = Enum.Font.GothamBold
    nameLabel.TextSize = 11
    nameLabel.TextColor3 = getTagColor(playerName)
    nameLabel.Text = displayName
    
    -- Message
    local msgLabel = Instance.new("TextLabel", notif)
    msgLabel.Size = UDim2.new(1, -60, 0, 22)
    msgLabel.Position = UDim2.new(0, 55, 0, 25)
    msgLabel.BackgroundTransparency = 1
    msgLabel.Text = message
    msgLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    msgLabel.Font = Enum.Font.Gotham
    msgLabel.TextSize = 11
    msgLabel.TextXAlignment = Enum.TextXAlignment.Left
    msgLabel.TextYAlignment = Enum.TextYAlignment.Top
    msgLabel.TextWrapped = true
    
    -- Animasi masuk (slide dari atas)
    notif.Position = UDim2.new(0, 0, 0, -60)
    notif.BackgroundTransparency = 1
    TweenService:Create(notif, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
        Position = UDim2.new(0, 0, 0, 0),
        BackgroundTransparency = 0.1
    }):Play()
    
    -- Hilang setelah 3 detik
    task.delay(3, function()
        TweenService:Create(notif, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
            Position = UDim2.new(0, 0, 0, -60),
            BackgroundTransparency = 1
        }):Play()
        task.wait(0.3)
        notif:Destroy()
    end)
end

-- ============================================================================
-- [[ FUNGSI TAG ]]
-- ============================================================================
local function getPlayerTag(playerName)
    if OWNER_LIST[playerName] then return "[ OWNER ]"
    elseif ADMIN_LIST[playerName] then return "[ ADMIN ]"
    end
    return nil
end

local function getTagColor(playerName)
    if OWNER_LIST[playerName] then return Color3.fromRGB(255, 215, 0)
    elseif ADMIN_LIST[playerName] then return Color3.fromRGB(0, 255, 100)
    end
    return Color3.fromRGB(255, 255, 255)
end

-- ============================================================================
-- [[ AVATAR ]]
-- ============================================================================
local avatarCache = {}

local function getAvatar(playerName)
    if avatarCache[playerName] then return avatarCache[playerName] end
    
    local url = "rbxassetid://106402256086666"
    pcall(function()
        local userId = Players:GetUserIdFromNameAsync(playerName)
        url = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. userId .. "&width=420&height=420&format=png"
    end)
    
    avatarCache[playerName] = url
    return url
end

-- ============================================================================
-- [[ TAMBAH CHAT ]]
-- ============================================================================
local chatHistory = {}
local MAX_CHAT = 100

local function addChatMessage(playerName, message, isSystem)
    local chatItem = Instance.new("Frame", chatScroll)
    chatItem.Size = UDim2.new(1, 0, 0, 50)
    chatItem.BackgroundColor3 = isSystem and Color3.fromRGB(30, 30, 0) or Color3.fromRGB(20, 0, 0)
    chatItem.BackgroundTransparency = 0.3
    chatItem.BorderSizePixel = 0
    Instance.new("UICorner", chatItem).CornerRadius = UDim.new(0, 6)
    
    local avatar = Instance.new("ImageLabel", chatItem)
    avatar.Size = UDim2.new(0, 40, 0, 40)
    avatar.Position = UDim2.new(0, 5, 0, 5)
    avatar.BackgroundColor3 = Color3.fromRGB(40, 0, 0)
    avatar.BorderSizePixel = 0
    avatar.Image = getAvatar(playerName)
    Instance.new("UICorner", avatar).CornerRadius = UDim.new(1, 0)
    
    local avStroke = Instance.new("UIStroke", avatar)
    avStroke.Thickness = 1.5
    avStroke.Color = getTagColor(playerName)
    
    local nameLabel = Instance.new("TextLabel", chatItem)
    nameLabel.Size = UDim2.new(1, -55, 0, 18)
    nameLabel.Position = UDim2.new(0, 50, 0, 4)
    nameLabel.BackgroundTransparency = 1
    nameLabel.TextXAlignment = Enum.TextXAlignment.Left
    nameLabel.Font = Enum.Font.GothamBold
    nameLabel.TextSize = 11
    
    local tag = getPlayerTag(playerName)
    if tag and not isSystem then
        nameLabel.Text = tag .. " " .. playerName
        nameLabel.TextColor3 = getTagColor(playerName)
    else
        nameLabel.Text = playerName
        nameLabel.TextColor3 = isSystem and Color3.fromRGB(255, 200, 0) or Color3.fromRGB(255, 100, 100)
    end
    
    local msgLabel = Instance.new("TextLabel", chatItem)
    msgLabel.Size = UDim2.new(1, -55, 0, 22)
    msgLabel.Position = UDim2.new(0, 50, 0, 22)
    msgLabel.BackgroundTransparency = 1
    msgLabel.Text = message
    msgLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    msgLabel.Font = Enum.Font.Gotham
    msgLabel.TextSize = 11
    msgLabel.TextXAlignment = Enum.TextXAlignment.Left
    msgLabel.TextYAlignment = Enum.TextYAlignment.Top
    msgLabel.TextWrapped = true
    
    task.wait(0.05)
    chatScroll.CanvasPosition = Vector2.new(0, chatScroll.AbsoluteCanvasSize.Y)
    
    table.insert(chatHistory, {name = playerName, msg = message, system = isSystem})
    
    if #chatHistory > MAX_CHAT then
        table.remove(chatHistory, 1)
        local firstChild = chatScroll:GetChildren()[1]
        if firstChild and firstChild:IsA("Frame") then
            firstChild:Destroy()
        end
    end
end

-- ============================================================================
-- [[ KIRIM CHAT + NOTIFIKASI ]]
-- ============================================================================
local function sendChat()
    local msg = inputBox.Text
    if msg == "" then return end
    inputBox.Text = ""
    
    -- Tambah ke chat utama
    addChatMessage(LP.Name, msg, false)
    
    -- Tampilkan notifikasi atas
    showNotification(LP.Name, msg)
end

sendBtn.MouseButton1Click:Connect(sendChat)
inputBox.FocusLost:Connect(function(enter)
    if enter then sendChat() end
end)

-- ============================================================================
-- [[ WELCOME / GOODBYE — CUMA BUAT YANG PAKE SCRIPT ]]
-- ============================================================================
local function onPlayerAdded(player)
    task.wait(1)
    
    local attr = player:GetAttribute("XaNaxChatUser")
    local isOwner = OWNER_LIST[player.Name]
    local isAdmin = ADMIN_LIST[player.Name]
    
    if attr == true or isOwner or isAdmin then
        scriptUsers[player.Name] = true
        
        local tag = getPlayerTag(player.Name)
        if tag then
            addChatMessage(player.Name, "👑 " .. tag .. " " .. player.Name .. " telah bergabung!", true)
        else
            addChatMessage(player.Name, "👋 Welcome " .. player.Name .. "!", true)
        end
    end
end

Players.PlayerAdded:Connect(onPlayerAdded)

Players.PlayerRemoving:Connect(function(player)
    if scriptUsers[player.Name] or OWNER_LIST[player.Name] or ADMIN_LIST[player.Name] then
        if OWNER_LIST[player.Name] then
            addChatMessage(player.Name, "👑 [ OWNER ] " .. player.Name .. " telah keluar.", true)
        elseif ADMIN_LIST[player.Name] then
            addChatMessage(player.Name, "👑 [ ADMIN ] " .. player.Name .. " telah keluar.", true)
        else
            addChatMessage(player.Name, "👋 " .. player.Name .. " telah keluar.", true)
        end
        scriptUsers[player.Name] = nil
    end
end)

task.spawn(function()
    task.wait(2)
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= LP then
            local attr = p:GetAttribute("XaNaxChatUser")
            local isOwner = OWNER_LIST[p.Name]
            local isAdmin = ADMIN_LIST[p.Name]
            
            if attr == true or isOwner or isAdmin then
                scriptUsers[p.Name] = true
                local tag = getPlayerTag(p.Name)
                if tag then
                    addChatMessage(p.Name, "👑 " .. tag .. " " .. p.Name .. " ada di server!", true)
                end
            end
        end
    end
end)

-- ============================================================================
-- [[ HIDE / SHOW ]]
-- ============================================================================
local isHidden = false

hideBtn.MouseButton1Click:Connect(function()
    isHidden = not isHidden
    main.Visible = not isHidden
    
    if isHidden then
        hideBtn.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
    else
        hideBtn.BackgroundColor3 = Color3.fromRGB(180, 0, 0)
    end
end)

-- ============================================================================
-- [[ DRAG ]]
-- ============================================================================
local function makeDraggable(frame, handle)
    handle = handle or frame
    local dragging, dragInput, dragStart, startPos
    
    handle.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 
           or input.UserInputType == Enum.UserInputType.Touch then
            dragging = true
            dragStart = input.Position
            startPos = frame.Position
        end
    end)
    
    handle.InputChanged:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseMovement 
           or input.UserInputType == Enum.UserInputType.Touch then
            dragInput = input
        end
    end)
    
    UIS.InputChanged:Connect(function(input)
        if input == dragInput and dragging then
            local delta = input.Position - dragStart
            frame.Position = UDim2.new(
                startPos.X.Scale, startPos.X.Offset + delta.X,
                startPos.Y.Scale, startPos.Y.Offset + delta.Y
            )
        end
    end)
    
    handle.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 
           or input.UserInputType == Enum.UserInputType.Touch then
            dragging = false
        end
    end)
end

makeDraggable(main, header)
makeDraggable(hideBtn)

-- ============================================================================
-- [[ INITIAL MESSAGE ]]
-- ============================================================================
task.wait(0.5)
addChatMessage("SYSTEM", "🌐 XaNax Chat loaded!", true)
addChatMessage(LP.Name, "Halo! Gue pake XaNax Chat 💬", false)
showNotification(LP.Name, "Halo! Gue pake XaNax Chat 💬")

print("🌐 XANAX CHAT — NOTIFIKASI ATAS LAYAR 3 DETIK")

Features & Information

Xanax

Community Comments (1)

67phh6767phh67Sep 12, 2026

Что делает скрипт напиши в тг @FEM6OYHOCTb

More Scripts for Universal Scripts