RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a icon at the top next to the chat icon"
-- local script for creating an icon next to the chat icon local StarterGui = game:GetService("StarterGui") local Players = game:GetService("Players") local function createIcon() local screenGui = Instance.new("ScreenGui") local iconButton = Instance.new("ImageButton") screenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui") screenGui.Name = "CustomIconButton" iconButton.Parent = screenGui iconButton.Size = UDim2.new(0, 24, 0, 24) iconButton.Position = UDim2.new(0, 0, 0, 0) -- Adjust this position to place it next to the chat icon iconButton.Image = "rbxassetid://12345678" -- Replace with your icon asset id iconButton.BackgroundTransparency = 1 iconButton.Name = "CustomIcon" -- Reposition the icon button when the core GUIs are repositioned (e.g., when the chat window is opened or closed) StarterGui.CoreGuiChangedSignal:Connect(function(coreGuiType, enabled) if coreGuiType == Enum.CoreGuiType.Chat or coreGuiType == Enum.CoreGuiType.All then if enabled then -- Adjust the position when the chat is visible iconButton.Position = UDim2.new(0, 36, 0, 0) -- Change this value based on the chat icon's position else -- Adjust the position when the chat is hidden iconButton.Position = UDim2.new(0, 0, 0, 0) -- Change this value based on the chat icon's position end end end) end createIcon()