local ok, err = xpcall(function()
local CoreGui = game:GetService("CoreGui")
local parentGui = (typeof(gethui) == "function" and gethui()) or CoreGui
local existing = parentGui:FindFirstChild("EmoteHub")
if existing then existing:Destroy() end
if CoreGui:FindFirstChild("EmoteHub") then CoreGui:FindFirstChild("EmoteHub"):Destroy() end
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local AvatarEditorService = game:GetService("AvatarEditorService")
local player = Players.LocalPlayer
local FONT_BOLD = Enum.Font.BuilderSansBold
local FONT_MEDIUM = Enum.Font.BuilderSansMedium
local FONT_REGULAR = Enum.Font.BuilderSans
local FONT_MONO = Enum.Font.Code
local COLORS = {
bg = Color3.fromRGB(6, 7, 10),
surface = Color3.fromRGB(15, 17, 22),
card = Color3.fromRGB(13, 15, 20),
border = Color3.fromRGB(34, 38, 48),
borderHover = Color3.fromRGB(70, 130, 235),
whitePill = Color3.fromRGB(242, 245, 250),
darkText = Color3.fromRGB(10, 12, 16),
text = Color3.fromRGB(238, 242, 248),
subtext = Color3.fromRGB(130, 138, 154),
blueAccent = Color3.fromRGB(56, 132, 245),
blueGlow = Color3.fromRGB(36, 98, 210),
hexDim = Color3.fromRGB(20, 23, 30),
hexWhite = Color3.fromRGB(215, 228, 248),
scrollbar = Color3.fromRGB(50, 58, 74),
}
local SORTS = {
{ label = "Popular", sort = Enum.CatalogSortType.MostFavorited },
{ label = "Bestselling", sort = Enum.CatalogSortType.Bestselling },
{ label = "Relevance", sort = Enum.CatalogSortType.Relevance },
{ label = "Newest", sort = Enum.CatalogSortType.RecentlyCreated },
{ label = "Low Price", sort = Enum.CatalogSortType.PriceLowToHigh },
{ label = "High Price", sort = Enum.CatalogSortType.PriceHighToLow },
}
local gui = Instance.new("ScreenGui")
gui.Name = "EmoteHub"
gui.ResetOnSpawn = false
gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
gui.DisplayOrder = 999
gui.Parent = parentGui
local main = Instance.new("Frame")
main.Name = "Main"
main.Size = UDim2.new(0, 368, 0, 530)
main.Position = UDim2.new(1, -383, 0, 15)
main.BackgroundColor3 = COLORS.bg
main.BorderSizePixel = 0
main.ClipsDescendants = true
main.Visible = false
main.Parent = gui
Instance.new("UICorner", main).CornerRadius = UDim.new(0, 12)
local mainStroke = Instance.new("UIStroke")
mainStroke.Color = COLORS.border
mainStroke.Thickness = 1.2
mainStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
mainStroke.Parent = main
-- Animated Hex-Wave Background (inset cleanly inside the rounded corners)
local hexBg = Instance.new("Frame")
hexBg.Name = "HexBackground"
hexBg.Size = UDim2.new(1, -12, 1, -12)
hexBg.Position = UDim2.new(0, 6, 0, 6)
hexBg.BackgroundTransparency = 1
hexBg.ZIndex = 0
hexBg.ClipsDescendants = true
hexBg.Parent = main
local HEX_CHARS = { "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" }
local function randomHexLine(len)
local t = table.create(len)
for i = 1, len do
t[i] = HEX_CHARS[math.random(1, 16)]
end
return table.concat(t, " ")
end
local hexRows = {}
local ROW_COUNT = 26
for r = 1, ROW_COUNT do
local row = Instance.new("TextLabel")
row.Name = "HexRow" .. r
row.Size = UDim2.new(1, 0, 0, 20)
row.Position = UDim2.new(0, 0, 0, (r - 1) * 20)
row.BackgroundTransparency = 1
row.Font = FONT_MONO
row.TextSize = 13
row.TextColor3 = Color3.new(1, 1, 1)
row.TextTransparency = 0.25
row.TextXAlignment = Enum.TextXAlignment.Left
row.Text = randomHexLine(26)
row.ZIndex = 0
row.Parent = hexBg
local grad = Instance.new("UIGradient")
grad.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0.00, COLORS.hexDim),
ColorSequenceKeypoint.new(0.32, COLORS.hexDim),
ColorSequenceKeypoint.new(0.45, COLORS.blueGlow),
ColorSequenceKeypoint.new(0.52, COLORS.hexWhite),
ColorSequenceKeypoint.new(0.59, COLORS.blueAccent),
ColorSequenceKeypoint.new(0.72, COLORS.hexDim),
ColorSequenceKeypoint.new(1.00, COLORS.hexDim),
})
grad.Rotation = 18
grad.Parent = row
table.insert(hexRows, { label = row, grad = grad, phase = r * 0.22 })
end
-- Vignette with matching UICorner so nothing pokes out of rounded edges
local vignette = Instance.new("Frame")
vignette.Size = UDim2.new(1, 0, 1, 0)
vignette.BackgroundColor3 = COLORS.bg
vignette.BackgroundTransparency = 0.35
vignette.BorderSizePixel = 0
vignette.ZIndex = 1
vignette.Parent = main
Instance.new("UICorner", vignette).CornerRadius = UDim.new(0, 12)
local content = Instance.new("Frame")
content.Name = "Content"
content.Size = UDim2.new(1, 0, 1, 0)
content.BackgroundTransparency = 1
content.ZIndex = 2
content.Parent = main
-- Title bar
local titleBar = Instance.new("Frame")
titleBar.Name = "TitleBar"
titleBar.Size = UDim2.new(1, 0, 0, 46)
titleBar.BackgroundTransparency = 1
titleBar.ZIndex = 2
titleBar.Parent = content
local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "Title"
titleLabel.Size = UDim2.new(1, -90, 1, 0)
titleLabel.Position = UDim2.new(0, 16, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "EMOTE CATALOG"
titleLabel.Font = FONT_BOLD
titleLabel.TextSize = 17
titleLabel.TextColor3 = COLORS.text
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.ZIndex = 2
titleLabel.Parent = titleBar
local keyHint = Instance.new("TextLabel")
keyHint.Name = "KeyHint"
keyHint.Size = UDim2.new(0, 42, 0, 24)
keyHint.Position = UDim2.new(1, -56, 0.5, -12)
keyHint.BackgroundColor3 = COLORS.surface
keyHint.BackgroundTransparency = 0.15
keyHint.BorderSizePixel = 0
keyHint.Text = "F5"
keyHint.Font = FONT_BOLD
keyHint.TextSize = 12
keyHint.TextColor3 = COLORS.text
keyHint.ZIndex = 2
keyHint.Parent = titleBar
Instance.new("UICorner", keyHint).CornerRadius = UDim.new(0, 6)
local khStroke = Instance.new("UIStroke")
khStroke.Color = COLORS.border
khStroke.Thickness = 1
khStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
khStroke.Parent = keyHint
local divider = Instance.new("Frame")
divider.Size = UDim2.new(1, -28, 0, 1)
divider.Position = UDim2.new(0, 14, 0, 46)
divider.BackgroundColor3 = COLORS.border
divider.BackgroundTransparency = 0.2
divider.BorderSizePixel = 0
divider.ZIndex = 2
divider.Parent = content
-- Search bar
local searchFrame = Instance.new("Frame")
searchFrame.Name = "SearchFrame"
searchFrame.Size = UDim2.new(1, -28, 0, 36)
searchFrame.Position = UDim2.new(0, 14, 0, 56)
searchFrame.BackgroundColor3 = COLORS.surface
searchFrame.BackgroundTransparency = 0.15
searchFrame.BorderSizePixel = 0
searchFrame.ZIndex = 2
searchFrame.Parent = content
Instance.new("UICorner", searchFrame).CornerRadius = UDim.new(0, 8)
local sfStroke = Instance.new("UIStroke")
sfStroke.Color = COLORS.border
sfStroke.Thickness = 1
sfStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
sfStroke.Parent = searchFrame
local searchBox = Instance.new("TextBox")
searchBox.Name = "SearchBox"
searchBox.Size = UDim2.new(1, -24, 1, 0)
searchBox.Position = UDim2.new(0, 12, 0, 0)
searchBox.BackgroundTransparency = 1
searchBox.PlaceholderText = "Search Roblox emote catalog..."
searchBox.PlaceholderColor3 = COLORS.subtext
searchBox.Text = ""
searchBox.Font = FONT_REGULAR
searchBox.TextSize = 14
searchBox.TextColor3 = COLORS.text
searchBox.TextXAlignment = Enum.TextXAlignment.Left
searchBox.ClearTextOnFocus = false
searchBox.ZIndex = 2
searchBox.Parent = searchFrame
-- Sort tabs
local catFrame = Instance.new("ScrollingFrame")
catFrame.Name = "Categories"
catFrame.Size = UDim2.new(1, -28, 0, 32)
catFrame.Position = UDim2.new(0, 14, 0, 99)
catFrame.BackgroundTransparency = 1
catFrame.BorderSizePixel = 0
catFrame.ScrollBarThickness = 0
catFrame.ScrollingDirection = Enum.ScrollingDirection.X
catFrame.AutomaticCanvasSize = Enum.AutomaticSize.X
catFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
catFrame.ZIndex = 2
catFrame.Parent = content
local catLayout = Instance.new("UIListLayout")
catLayout.FillDirection = Enum.FillDirection.Horizontal
catLayout.VerticalAlignment = Enum.VerticalAlignment.Center
catLayout.Padding = UDim.new(0, 6)
catLayout.SortOrder = Enum.SortOrder.LayoutOrder
catLayout.Parent = catFrame
local catPad = Instance.new("UIPadding")
catPad.PaddingLeft = UDim.new(0, 2)
catPad.PaddingRight = UDim.new(0, 2)
catPad.Parent = catFrame
local currentSort = SORTS[1].sort
local sortButtons = {}
for i, sortInfo in ipairs(SORTS) do
local isFirst = (i == 1)
local btn = Instance.new("TextButton")
btn.Name = sortInfo.label
btn.Size = UDim2.new(0, 0, 0, 28)
btn.AutomaticSize = Enum.AutomaticSize.X
btn.BackgroundColor3 = isFirst and COLORS.whitePill or COLORS.surface
btn.BackgroundTransparency = isFirst and 0 or 0.15
btn.BorderSizePixel = 0
btn.Text = sortInfo.label
btn.Font = FONT_BOLD
btn.TextSize = 13
btn.TextColor3 = isFirst and COLORS.darkText or COLORS.subtext
btn.LayoutOrder = i
btn.ZIndex = 2
btn.Parent = catFrame
Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 7)
local bStroke = Instance.new("UIStroke")
bStroke.Color = isFirst and COLORS.whitePill or COLORS.border
bStroke.Thickness = 1
bStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
bStroke.Parent = btn
local pad = Instance.new("UIPadding")
pad.PaddingLeft = UDim.new(0, 11)
pad.PaddingRight = UDim.new(0, 11)
pad.Parent = btn
sortButtons[sortInfo.label] = { btn = btn, stroke = bStroke, sort = sortInfo.sort }
end
-- Emote grid (inset cleanly inside panel)
local scrollFrame = Instance.new("ScrollingFrame")
scrollFrame.Name = "EmoteGrid"
scrollFrame.Size = UDim2.new(1, -24, 1, -152)
scrollFrame.Position = UDim2.new(0, 12, 0, 138)
scrollFrame.BackgroundTransparency = 1
scrollFrame.BorderSizePixel = 0
scrollFrame.ScrollBarThickness = 4
scrollFrame.ScrollBarImageColor3 = COLORS.scrollbar
scrollFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
scrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
scrollFrame.ZIndex = 2
scrollFrame.Parent = content
local gridPad = Instance.new("UIPadding")
gridPad.PaddingTop = UDim.new(0, 4)
gridPad.PaddingBottom = UDim.new(0, 6)
gridPad.Parent = scrollFrame
local gridLayout = Instance.new("UIGridLayout")
gridLayout.CellSize = UDim2.fromOffset(102, 136)
gridLayout.CellPadding = UDim2.fromOffset(10, 10)
gridLayout.SortOrder = Enum.SortOrder.LayoutOrder
gridLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
gridLayout.Parent = scrollFrame
-- Now playing bar (floating rounded pill inside bottom edge)
local nowPlaying = Instance.new("Frame")
nowPlaying.Name = "NowPlaying"
nowPlaying.Size = UDim2.new(1, -20, 0, 36)
nowPlaying.Position = UDim2.new(0, 10, 1, -46)
nowPlaying.BackgroundColor3 = COLORS.surface
nowPlaying.BackgroundTransparency = 0.08
nowPlaying.BorderSizePixel = 0
nowPlaying.Visible = false
nowPlaying.ZIndex = 3
nowPlaying.Parent = content
Instance.new("UICorner", nowPlaying).CornerRadius = UDim.new(0, 8)
local npStroke = Instance.new("UIStroke")
npStroke.Color = COLORS.border
npStroke.Thickness = 1
npStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
npStroke.Parent = nowPlaying
local npLabel = Instance.new("TextLabel")
npLabel.Size = UDim2.new(1, -78, 1, 0)
npLabel.Position = UDim2.new(0, 12, 0, 0)
npLabel.BackgroundTransparency = 1
npLabel.Text = "Playing: ..."
npLabel.Font = FONT_BOLD
npLabel.TextSize = 13
npLabel.TextColor3 = COLORS.blueAccent
npLabel.TextXAlignment = Enum.TextXAlignment.Left
npLabel.TextTruncate = Enum.TextTruncate.AtEnd
npLabel.ZIndex = 3
npLabel.Parent = nowPlaying
local stopBtn = Instance.new("TextButton")
stopBtn.Size = UDim2.new(0, 54, 0, 24)
stopBtn.Position = UDim2.new(1, -62, 0.5, -12)
stopBtn.BackgroundColor3 = COLORS.whitePill
stopBtn.BorderSizePixel = 0
stopBtn.Text = "Stop"
stopBtn.Font = FONT_BOLD
stopBtn.TextSize = 12
stopBtn.TextColor3 = COLORS.darkText
stopBtn.ZIndex = 3
stopBtn.Parent = nowPlaying
Instance.new("UICorner", stopBtn).CornerRadius = UDim.new(0, 6)
local function getR15PreviewRig()
local char = player and player.Character
if char and char:FindFirstChildOfClass("Humanoid") then
local wasArch = char.Archivable
char.Archivable = true
local clone = char:Clone()
char.Archivable = wasArch
if clone then
for _, desc in ipairs(clone:GetDescendants()) do
if desc:IsA("Script") or desc:IsA("LocalScript") or desc:IsA("ModuleScript")
or desc:IsA("Sound") or desc:IsA("ForceField") then
desc:Destroy()
elseif desc:IsA("BasePart") then
desc.Anchored = false
desc.CanCollide = false
end
end
local hrp = clone:FindFirstChild("HumanoidRootPart")
if hrp then hrp.Anchored = true end
local hum = clone:FindFirstChildOfClass("Humanoid")
if hum then
hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
end
return clone
end
end
return nil
end
local animCache = {}
local function resolveAnimId(catalogId)
if animCache[catalogId] then
return animCache[catalogId]
end
local okObj, objs = pcall(function()
return game:GetObjects("rbxassetid://" .. catalogId)
end)
if okObj and objs and objs[1] then
local root = objs[1]
local anim = root:IsA("Animation") and root or root:FindFirstChildOfClass("Animation", true)
if anim and anim.AnimationId ~= "" then
animCache[catalogId] = anim.AnimationId
return anim.AnimationId
end
end
return nil
end
local currentlyPlayingCard = nil
local activeTrack = nil
local function stopCurrentEmote()
if activeTrack then
pcall(function() activeTrack:Stop() end)
activeTrack = nil
end
if currentlyPlayingCard and currentlyPlayingCard.Parent then
local oldStroke = currentlyPlayingCard:FindFirstChildOfClass("UIStroke")
if oldStroke then
TweenService:Create(oldStroke, TweenInfo.new(0.2), {Color = COLORS.border}):Play()
end
end
currentlyPlayingCard = nil
nowPlaying.Visible = false
scrollFrame.Size = UDim2.new(1, -24, 1, -152)
end
stopBtn.MouseButton1Click:Connect(stopCurrentEmote)
local cardCounter = 0
local function createCatalogCard(item)
cardCounter = cardCounter + 1
local card = Instance.new("Frame")
card.Name = item.Name or ("Emote_" .. tostring(item.Id))
card.BackgroundColor3 = COLORS.card
card.BackgroundTransparency = 0.22
card.BorderSizePixel = 0
card.LayoutOrder = cardCounter
card.ZIndex = 2
card.Parent = scrollFrame
Instance.new("UICorner", card).CornerRadius = UDim.new(0, 9)
local cardStroke = Instance.new("UIStroke")
cardStroke.Color = COLORS.border
cardStroke.Thickness = 1
cardStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
cardStroke.Parent = card
local previewBox = Instance.new("Frame")
previewBox.Name = "PreviewBox"
previewBox.Size = UDim2.new(1, -12, 0, 78)
previewBox.Position = UDim2.new(0, 6, 0, 6)
previewBox.BackgroundColor3 = Color3.fromRGB(9, 10, 14)
previewBox.BackgroundTransparency = 0.2
previewBox.BorderSizePixel = 0
previewBox.ClipsDescendants = true
previewBox.ZIndex = 2
previewBox.Parent = card
Instance.new("UICorner", previewBox).CornerRadius = UDim.new(0, 7)
local thumb = Instance.new("ImageLabel")
thumb.Name = "Thumb"
thumb.Size = UDim2.new(1, 0, 1, 0)
thumb.BackgroundTransparency = 1
thumb.ScaleType = Enum.ScaleType.Fit
thumb.Image = "rbxthumb://type=Asset&id=" .. tostring(item.Id) .. "&w=150&h=150"
thumb.ZIndex = 2
thumb.Parent = previewBox
local previewStarted = false
local function startR15Preview()
if previewStarted then return end
previewStarted = true
task.spawn(function()
local animId = resolveAnimId(item.Id)
local rig = getR15PreviewRig()
if not animId or not rig or not card.Parent then return end
local viewport = Instance.new("ViewportFrame")
viewport.Name = "Preview"
viewport.Size = UDim2.new(1, 0, 1, 0)
viewport.BackgroundTransparency = 1
viewport.BorderSizePixel = 0
viewport.Ambient = Color3.fromRGB(165, 175, 195)
viewport.LightColor = Color3.fromRGB(255, 255, 255)
viewport.LightDirection = Vector3.new(-1, -1, 1)
viewport.ZIndex = 2
viewport.Parent = previewBox
local worldModel = Instance.new("WorldModel")
worldModel.Parent = viewport
local cam = Instance.new("Camera")
cam.CFrame = CFrame.new(Vector3.new(0, 0.4, -5.8), Vector3.new(0, 0.2, 0))
cam.FieldOfView = 38
cam.Parent = viewport
viewport.CurrentCamera = cam
rig:PivotTo(CFrame.new(0, 0, 0))
rig.Parent = worldModel
pcall(function()
local hum = rig:FindFirstChildOfClass("Humanoid")
local animator = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator", hum)
local anim = Instance.new("Animation")
anim.AnimationId = animId
local track = animator:LoadAnimation(anim)
track.Looped = true
track:Play()
end)
thumb.Visible = false
end)
end
local nameLabel = Instance.new("TextLabel")
nameLabel.Name = "EmoteName"
nameLabel.Size = UDim2.new(1, -8, 0, 20)
nameLabel.Position = UDim2.new(0, 4, 0, 88)
nameLabel.BackgroundTransparency = 1
nameLabel.Text = item.Name or "Emote"
nameLabel.Font = FONT_MEDIUM
nameLabel.TextSize = 13
nameLabel.TextColor3 = COLORS.text
nameLabel.TextTruncate = Enum.TextTruncate.AtEnd
nameLabel.ZIndex = 2
nameLabel.Parent = card
local priceText = (item.Price and item.Price > 0) and ("R$ " .. tostring(item.Price)) or "Free"
local subLabel = Instance.new("TextLabel")
subLabel.Name = "SubLabel"
subLabel.Size = UDim2.new(1, -8, 0, 16)
subLabel.Position = UDim2.new(0, 4, 0, 109)
subLabel.BackgroundTransparency = 1
subLabel.Text = priceText
subLabel.Font = FONT_REGULAR
subLabel.TextSize = 12
subLabel.TextColor3 = COLORS.subtext
subLabel.ZIndex = 2
subLabel.Parent = card
local clickBtn = Instance.new("TextButton")
clickBtn.Name = "ClickArea"
clickBtn.Size = UDim2.new(1, 0, 1, 0)
clickBtn.BackgroundTransparency = 1
clickBtn.Text = ""
clickBtn.ZIndex = 3
clickBtn.Parent = card
clickBtn.MouseEnter:Connect(function()
startR15Preview()
TweenService:Create(cardStroke, TweenInfo.new(0.15), {Color = COLORS.borderHover}):Play()
end)
clickBtn.MouseLeave:Connect(function()
local isPlaying = (currentlyPlayingCard == card)
TweenService:Create(cardStroke, TweenInfo.new(0.15), {Color = isPlaying and COLORS.blueAccent or COLORS.border}):Play()
end)
clickBtn.MouseButton1Click:Connect(function()
startR15Preview()
if currentlyPlayingCard == card then
stopCurrentEmote()
return
end
stopCurrentEmote()
currentlyPlayingCard = card
TweenService:Create(cardStroke, TweenInfo.new(0.15), {Color = COLORS.blueAccent}):Play()
nowPlaying.Visible = true
npLabel.Text = "Playing: " .. (item.Name or "Emote")
scrollFrame.Size = UDim2.new(1, -24, 1, -196)
task.spawn(function()
local animId = resolveAnimId(item.Id)
if not animId then return end
pcall(function()
local char = player.Character
if not char then return end
local hum = char:FindFirstChildOfClass("Humanoid")
if not hum then return end
local animator = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator", hum)
local anim = Instance.new("Animation")
anim.AnimationId = animId
local track = animator:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action4
track.Looped = true
track:Play()
activeTrack = track
end)
end)
end)
end
-- Dynamic Catalog Query Engine
local queryToken = 0
local currentPages = nil
local isLoadingPage = false
local function clearGrid()
for _, child in ipairs(scrollFrame:GetChildren()) do
if child:IsA("Frame") then
child:Destroy()
end
end
cardCounter = 0
currentlyPlayingCard = nil
end
local function loadNextPage(token)
if isLoadingPage or not currentPages or token ~= queryToken then return end
isLoadingPage = true
task.spawn(function()
local page = currentPages:GetCurrentPage()
if token ~= queryToken then
isLoadingPage = false
return
end
for _, item in ipairs(page) do
if token ~= queryToken then break end
createCatalogCard(item)
end
if not currentPages.IsFinished and token == queryToken then
pcall(function() currentPages:AdvanceToNextPageAsync() end)
else
currentPages = nil
end
isLoadingPage = false
end)
end
local function startCatalogQuery(keyword, sortType)
queryToken = queryToken + 1
local token = queryToken
isLoadingPage = false
currentPages = nil
clearGrid()
scrollFrame.CanvasPosition = Vector2.new(0, 0)
task.spawn(function()
local okCat, pages = pcall(function()
local p = CatalogSearchParams.new()
p.AssetTypes = { Enum.AvatarAssetType.EmoteAnimation }
p.SortType = sortType
p.Limit = 120
if keyword and keyword ~= "" then
p.SearchKeyword = keyword
end
return AvatarEditorService:SearchCatalog(p)
end)
if token ~= queryToken then return end
if okCat and pages then
currentPages = pages
loadNextPage(token)
task.wait(0.2)
if token == queryToken and currentPages then
loadNextPage(token)
end
end
end)
end
scrollFrame:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
if currentPages and not isLoadingPage then
local maxY = math.max(0, scrollFrame.AbsoluteCanvasSize.Y - scrollFrame.AbsoluteWindowSize.Y)
if maxY > 0 and scrollFrame.CanvasPosition.Y >= maxY - 300 then
loadNextPage(queryToken)
end
end
end)
local searchSerial = 0
searchBox:GetPropertyChangedSignal("Text"):Connect(function()
searchSerial = searchSerial + 1
local mySerial = searchSerial
task.delay(0.35, function()
if mySerial == searchSerial then
startCatalogQuery(searchBox.Text, currentSort)
end
end)
end)
for _, info in pairs(sortButtons) do
info.btn.MouseButton1Click:Connect(function()
currentSort = info.sort
for _, other in pairs(sortButtons) do
local isSel = (other.btn == info.btn)
TweenService:Create(other.btn, TweenInfo.new(0.15), {
BackgroundColor3 = isSel and COLORS.whitePill or COLORS.surface,
BackgroundTransparency = isSel and 0 or 0.15,
}):Play()
TweenService:Create(other.stroke, TweenInfo.new(0.15), {
Color = isSel and COLORS.whitePill or COLORS.border,
}):Play()
other.btn.TextColor3 = isSel and COLORS.darkText or COLORS.subtext
end
startCatalogQuery(searchBox.Text, currentSort)
end)
end
-- Animate hex-wave background when UI is visible
local elapsed = 0
local mutateAccum = 0
RunService.RenderStepped:Connect(function(dt)
if not gui.Parent or not main.Visible then return end
elapsed = elapsed + dt
mutateAccum = mutateAccum + dt
for _, row in ipairs(hexRows) do
local wave = math.sin(elapsed * 0.9 + row.phase) * 0.55
row.grad.Offset = Vector2.new(wave, 0)
end
if mutateAccum >= 0.35 then
mutateAccum = 0
local pick = hexRows[math.random(1, #hexRows)]
if pick then
pick.label.Text = randomHexLine(26)
end
end
end)
-- F5 Toggle
local uiOpen = false
local function toggleUI()
uiOpen = not uiOpen
if uiOpen then
main.Visible = true
main.Size = UDim2.new(0, 368, 0, 0)
main.BackgroundTransparency = 0.25
TweenService:Create(main, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
Size = UDim2.new(0, 368, 0, 530),
BackgroundTransparency = 0,
}):Play()
else
local tween = TweenService:Create(main, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
Size = UDim2.new(0, 368, 0, 0),
BackgroundTransparency = 0.25,
})
tween:Play()
tween.Completed:Connect(function()
if not uiOpen then
main.Visible = false
end
end)
end
end
UserInputService.InputBegan:Connect(function(input)
if UserInputService:GetFocusedTextBox() then return end
if input.KeyCode == Enum.KeyCode.F5 then
toggleUI()
end
end)
startCatalogQuery("", currentSort)
print("Emote Catalog edges fixed! Press F5.")
end, debug.traceback)
if not ok then
warn("EmoteHub error:", err)
endEmotes are paid, I find that annoying. Sooo I made an universal emote catalogue lads, so bye bye paid emotes. When you scroll on the UI, your fps might drop. A fix is gonna come in that later update
Update log:
No comments yet. Be the first to comment!
1local ok, err = xpcall(function()
2 local CoreGui = game:GetService("CoreGui")
3 local parentGui = (typeof(gethui) == "function" and gethui()) or CoreGui
4
5 local existing = parentGui:FindFirstChild("EmoteHub")
6 if existing then existing:Destroy() end
7 if CoreGui:FindFirstChild("EmoteHub") then CoreGui:FindFirstChild("EmoteHub"):Destroy() end
8
9 local Players = game:GetService("Players")
10 local UserInputService = game:GetService("UserInputService")
11 local TweenService = game:GetService("TweenService")
12 local RunService = game:GetService("RunService")
13 local AvatarEditorService = game:GetService("AvatarEditorService")
14 local player = Players.LocalPlayer
15
16 local FONT_BOLD = Enum.Font.BuilderSansBold
17 local FONT_MEDIUM = Enum.Font.BuilderSansMedium
18 local FONT_REGULAR = Enum.Font.BuilderSans
19 local FONT_MONO = Enum.Font.Code
20
21 local COLORS = {
22 bg = Color3.fromRGB(6, 7, 10),
23 surface = Color3.fromRGB(15, 17, 22),
24 card = Color3.fromRGB(13, 15, 20),
25 border = Color3.fromRGB(34, 38, 48),
26 borderHover = Color3.fromRGB(70, 130, 235),
27 whitePill = Color3.fromRGB(242, 245, 250),
28 darkText = Color3.fromRGB(10, 12, 16),
29 text = Color3.fromRGB(238, 242, 248),
30 subtext = Color3.fromRGB(130, 138, 154),
31 blueAccent = Color3.fromRGB(56, 132, 245),
32 blueGlow = Color3.fromRGB(36, 98, 210),
33 hexDim = Color3.fromRGB(20, 23, 30),
34 hexWhite = Color3.fromRGB(215, 228, 248),
35 scrollbar = Color3.fromRGB(50, 58, 74),
36 }
37
38 local SORTS = {
39 { label = "Popular", sort = Enum.CatalogSortType.MostFavorited },
40 { label = "Bestselling", sort = Enum.CatalogSortType.Bestselling },
41 { label = "Relevance", sort = Enum.CatalogSortType.Relevance },
42 { label = "Newest", sort = Enum.CatalogSortType.RecentlyCreated },
43 { label = "Low Price", sort = Enum.CatalogSortType.PriceLowToHigh },
44 { label = "High Price", sort = Enum.CatalogSortType.PriceHighToLow },
45 }
46
47 local gui = Instance.new("ScreenGui")
48 gui.Name = "EmoteHub"
49 gui.ResetOnSpawn = false
50 gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
51 gui.DisplayOrder = 999
52 gui.Parent = parentGui
53
54 local main = Instance.new("Frame")
55 main.Name = "Main"
56 main.Size = UDim2.new(0, 368, 0, 530)
57 main.Position = UDim2.new(1, -383, 0, 15)
58 main.BackgroundColor3 = COLORS.bg
59 main.BorderSizePixel = 0
60 main.ClipsDescendants = true
61 main.Visible = false
62 main.Parent = gui
63 Instance.new("UICorner", main).CornerRadius = UDim.new(0, 12)
64
65 local mainStroke = Instance.new("UIStroke")
66 mainStroke.Color = COLORS.border
67 mainStroke.Thickness = 1.2
68 mainStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
69 mainStroke.Parent = main
70
71 -- Animated Hex-Wave Background (inset cleanly inside the rounded corners)
72 local hexBg = Instance.new("Frame")
73 hexBg.Name = "HexBackground"
74 hexBg.Size = UDim2.new(1, -12, 1, -12)
75 hexBg.Position = UDim2.new(0, 6, 0, 6)
76 hexBg.BackgroundTransparency = 1
77 hexBg.ZIndex = 0
78 hexBg.ClipsDescendants = true
79 hexBg.Parent = main
80
81 local HEX_CHARS = { "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f" }
82 local function randomHexLine(len)
83 local t = table.create(len)
84 for i = 1, len do
85 t[i] = HEX_CHARS[math.random(1, 16)]
86 end
87 return table.concat(t, " ")
88 end
89
90 local hexRows = {}
91 local ROW_COUNT = 26
92 for r = 1, ROW_COUNT do
93 local row = Instance.new("TextLabel")
94 row.Name = "HexRow" .. r
95 row.Size = UDim2.new(1, 0, 0, 20)
96 row.Position = UDim2.new(0, 0, 0, (r - 1) * 20)
97 row.BackgroundTransparency = 1
98 row.Font = FONT_MONO
99 row.TextSize = 13
100 row.TextColor3 = Color3.new(1, 1, 1)
101 row.TextTransparency = 0.25
102 row.TextXAlignment = Enum.TextXAlignment.Left
103 row.Text = randomHexLine(26)
104 row.ZIndex = 0
105 row.Parent = hexBg
106
107 local grad = Instance.new("UIGradient")
108 grad.Color = ColorSequence.new({
109 ColorSequenceKeypoint.new(0.00, COLORS.hexDim),
110 ColorSequenceKeypoint.new(0.32, COLORS.hexDim),
111 ColorSequenceKeypoint.new(0.45, COLORS.blueGlow),
112 ColorSequenceKeypoint.new(0.52, COLORS.hexWhite),
113 ColorSequenceKeypoint.new(0.59, COLORS.blueAccent),
114 ColorSequenceKeypoint.new(0.72, COLORS.hexDim),
115 ColorSequenceKeypoint.new(1.00, COLORS.hexDim),
116 })
117 grad.Rotation = 18
118 grad.Parent = row
119
120 table.insert(hexRows, { label = row, grad = grad, phase = r * 0.22 })
121 end
122
123 -- Vignette with matching UICorner so nothing pokes out of rounded edges
124 local vignette = Instance.new("Frame")
125 vignette.Size = UDim2.new(1, 0, 1, 0)
126 vignette.BackgroundColor3 = COLORS.bg
127 vignette.BackgroundTransparency = 0.35
128 vignette.BorderSizePixel = 0
129 vignette.ZIndex = 1
130 vignette.Parent = main
131 Instance.new("UICorner", vignette).CornerRadius = UDim.new(0, 12)
132
133 local content = Instance.new("Frame")
134 content.Name = "Content"
135 content.Size = UDim2.new(1, 0, 1, 0)
136 content.BackgroundTransparency = 1
137 content.ZIndex = 2
138 content.Parent = main
139
140 -- Title bar
141 local titleBar = Instance.new("Frame")
142 titleBar.Name = "TitleBar"
143 titleBar.Size = UDim2.new(1, 0, 0, 46)
144 titleBar.BackgroundTransparency = 1
145 titleBar.ZIndex = 2
146 titleBar.Parent = content
147
148 local titleLabel = Instance.new("TextLabel")
149 titleLabel.Name = "Title"
150 titleLabel.Size = UDim2.new(1, -90, 1, 0)
151 titleLabel.Position = UDim2.new(0, 16, 0, 0)
152 titleLabel.BackgroundTransparency = 1
153 titleLabel.Text = "EMOTE CATALOG"
154 titleLabel.Font = FONT_BOLD
155 titleLabel.TextSize = 17
156 titleLabel.TextColor3 = COLORS.text
157 titleLabel.TextXAlignment = Enum.TextXAlignment.Left
158 titleLabel.ZIndex = 2
159 titleLabel.Parent = titleBar
160
161 local keyHint = Instance.new("TextLabel")
162 keyHint.Name = "KeyHint"
163 keyHint.Size = UDim2.new(0, 42, 0, 24)
164 keyHint.Position = UDim2.new(1, -56, 0.5, -12)
165 keyHint.BackgroundColor3 = COLORS.surface
166 keyHint.BackgroundTransparency = 0.15
167 keyHint.BorderSizePixel = 0
168 keyHint.Text = "F5"
169 keyHint.Font = FONT_BOLD
170 keyHint.TextSize = 12
171 keyHint.TextColor3 = COLORS.text
172 keyHint.ZIndex = 2
173 keyHint.Parent = titleBar
174 Instance.new("UICorner", keyHint).CornerRadius = UDim.new(0, 6)
175 local khStroke = Instance.new("UIStroke")
176 khStroke.Color = COLORS.border
177 khStroke.Thickness = 1
178 khStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
179 khStroke.Parent = keyHint
180
181 local divider = Instance.new("Frame")
182 divider.Size = UDim2.new(1, -28, 0, 1)
183 divider.Position = UDim2.new(0, 14, 0, 46)
184 divider.BackgroundColor3 = COLORS.border
185 divider.BackgroundTransparency = 0.2
186 divider.BorderSizePixel = 0
187 divider.ZIndex = 2
188 divider.Parent = content
189
190 -- Search bar
191 local searchFrame = Instance.new("Frame")
192 searchFrame.Name = "SearchFrame"
193 searchFrame.Size = UDim2.new(1, -28, 0, 36)
194 searchFrame.Position = UDim2.new(0, 14, 0, 56)
195 searchFrame.BackgroundColor3 = COLORS.surface
196 searchFrame.BackgroundTransparency = 0.15
197 searchFrame.BorderSizePixel = 0
198 searchFrame.ZIndex = 2
199 searchFrame.Parent = content
200 Instance.new("UICorner", searchFrame).CornerRadius = UDim.new(0, 8)
201 local sfStroke = Instance.new("UIStroke")
202 sfStroke.Color = COLORS.border
203 sfStroke.Thickness = 1
204 sfStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
205 sfStroke.Parent = searchFrame
206
207 local searchBox = Instance.new("TextBox")
208 searchBox.Name = "SearchBox"
209 searchBox.Size = UDim2.new(1, -24, 1, 0)
210 searchBox.Position = UDim2.new(0, 12, 0, 0)
211 searchBox.BackgroundTransparency = 1
212 searchBox.PlaceholderText = "Search Roblox emote catalog..."
213 searchBox.PlaceholderColor3 = COLORS.subtext
214 searchBox.Text = ""
215 searchBox.Font = FONT_REGULAR
216 searchBox.TextSize = 14
217 searchBox.TextColor3 = COLORS.text
218 searchBox.TextXAlignment = Enum.TextXAlignment.Left
219 searchBox.ClearTextOnFocus = false
220 searchBox.ZIndex = 2
221 searchBox.Parent = searchFrame
222
223 -- Sort tabs
224 local catFrame = Instance.new("ScrollingFrame")
225 catFrame.Name = "Categories"
226 catFrame.Size = UDim2.new(1, -28, 0, 32)
227 catFrame.Position = UDim2.new(0, 14, 0, 99)
228 catFrame.BackgroundTransparency = 1
229 catFrame.BorderSizePixel = 0
230 catFrame.ScrollBarThickness = 0
231 catFrame.ScrollingDirection = Enum.ScrollingDirection.X
232 catFrame.AutomaticCanvasSize = Enum.AutomaticSize.X
233 catFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
234 catFrame.ZIndex = 2
235 catFrame.Parent = content
236
237 local catLayout = Instance.new("UIListLayout")
238 catLayout.FillDirection = Enum.FillDirection.Horizontal
239 catLayout.VerticalAlignment = Enum.VerticalAlignment.Center
240 catLayout.Padding = UDim.new(0, 6)
241 catLayout.SortOrder = Enum.SortOrder.LayoutOrder
242 catLayout.Parent = catFrame
243
244 local catPad = Instance.new("UIPadding")
245 catPad.PaddingLeft = UDim.new(0, 2)
246 catPad.PaddingRight = UDim.new(0, 2)
247 catPad.Parent = catFrame
248
249 local currentSort = SORTS[1].sort
250 local sortButtons = {}
251 for i, sortInfo in ipairs(SORTS) do
252 local isFirst = (i == 1)
253 local btn = Instance.new("TextButton")
254 btn.Name = sortInfo.label
255 btn.Size = UDim2.new(0, 0, 0, 28)
256 btn.AutomaticSize = Enum.AutomaticSize.X
257 btn.BackgroundColor3 = isFirst and COLORS.whitePill or COLORS.surface
258 btn.BackgroundTransparency = isFirst and 0 or 0.15
259 btn.BorderSizePixel = 0
260 btn.Text = sortInfo.label
261 btn.Font = FONT_BOLD
262 btn.TextSize = 13
263 btn.TextColor3 = isFirst and COLORS.darkText or COLORS.subtext
264 btn.LayoutOrder = i
265 btn.ZIndex = 2
266 btn.Parent = catFrame
267 Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 7)
268 local bStroke = Instance.new("UIStroke")
269 bStroke.Color = isFirst and COLORS.whitePill or COLORS.border
270 bStroke.Thickness = 1
271 bStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
272 bStroke.Parent = btn
273 local pad = Instance.new("UIPadding")
274 pad.PaddingLeft = UDim.new(0, 11)
275 pad.PaddingRight = UDim.new(0, 11)
276 pad.Parent = btn
277 sortButtons[sortInfo.label] = { btn = btn, stroke = bStroke, sort = sortInfo.sort }
278 end
279
280 -- Emote grid (inset cleanly inside panel)
281 local scrollFrame = Instance.new("ScrollingFrame")
282 scrollFrame.Name = "EmoteGrid"
283 scrollFrame.Size = UDim2.new(1, -24, 1, -152)
284 scrollFrame.Position = UDim2.new(0, 12, 0, 138)
285 scrollFrame.BackgroundTransparency = 1
286 scrollFrame.BorderSizePixel = 0
287 scrollFrame.ScrollBarThickness = 4
288 scrollFrame.ScrollBarImageColor3 = COLORS.scrollbar
289 scrollFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
290 scrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
291 scrollFrame.ZIndex = 2
292 scrollFrame.Parent = content
293
294 local gridPad = Instance.new("UIPadding")
295 gridPad.PaddingTop = UDim.new(0, 4)
296 gridPad.PaddingBottom = UDim.new(0, 6)
297 gridPad.Parent = scrollFrame
298
299 local gridLayout = Instance.new("UIGridLayout")
300 gridLayout.CellSize = UDim2.fromOffset(102, 136)
301 gridLayout.CellPadding = UDim2.fromOffset(10, 10)
302 gridLayout.SortOrder = Enum.SortOrder.LayoutOrder
303 gridLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
304 gridLayout.Parent = scrollFrame
305
306 -- Now playing bar (floating rounded pill inside bottom edge)
307 local nowPlaying = Instance.new("Frame")
308 nowPlaying.Name = "NowPlaying"
309 nowPlaying.Size = UDim2.new(1, -20, 0, 36)
310 nowPlaying.Position = UDim2.new(0, 10, 1, -46)
311 nowPlaying.BackgroundColor3 = COLORS.surface
312 nowPlaying.BackgroundTransparency = 0.08
313 nowPlaying.BorderSizePixel = 0
314 nowPlaying.Visible = false
315 nowPlaying.ZIndex = 3
316 nowPlaying.Parent = content
317 Instance.new("UICorner", nowPlaying).CornerRadius = UDim.new(0, 8)
318 local npStroke = Instance.new("UIStroke")
319 npStroke.Color = COLORS.border
320 npStroke.Thickness = 1
321 npStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
322 npStroke.Parent = nowPlaying
323
324 local npLabel = Instance.new("TextLabel")
325 npLabel.Size = UDim2.new(1, -78, 1, 0)
326 npLabel.Position = UDim2.new(0, 12, 0, 0)
327 npLabel.BackgroundTransparency = 1
328 npLabel.Text = "Playing: ..."
329 npLabel.Font = FONT_BOLD
330 npLabel.TextSize = 13
331 npLabel.TextColor3 = COLORS.blueAccent
332 npLabel.TextXAlignment = Enum.TextXAlignment.Left
333 npLabel.TextTruncate = Enum.TextTruncate.AtEnd
334 npLabel.ZIndex = 3
335 npLabel.Parent = nowPlaying
336
337 local stopBtn = Instance.new("TextButton")
338 stopBtn.Size = UDim2.new(0, 54, 0, 24)
339 stopBtn.Position = UDim2.new(1, -62, 0.5, -12)
340 stopBtn.BackgroundColor3 = COLORS.whitePill
341 stopBtn.BorderSizePixel = 0
342 stopBtn.Text = "Stop"
343 stopBtn.Font = FONT_BOLD
344 stopBtn.TextSize = 12
345 stopBtn.TextColor3 = COLORS.darkText
346 stopBtn.ZIndex = 3
347 stopBtn.Parent = nowPlaying
348 Instance.new("UICorner", stopBtn).CornerRadius = UDim.new(0, 6)
349
350 local function getR15PreviewRig()
351 local char = player and player.Character
352 if char and char:FindFirstChildOfClass("Humanoid") then
353 local wasArch = char.Archivable
354 char.Archivable = true
355 local clone = char:Clone()
356 char.Archivable = wasArch
357 if clone then
358 for _, desc in ipairs(clone:GetDescendants()) do
359 if desc:IsA("Script") or desc:IsA("LocalScript") or desc:IsA("ModuleScript")
360 or desc:IsA("Sound") or desc:IsA("ForceField") then
361 desc:Destroy()
362 elseif desc:IsA("BasePart") then
363 desc.Anchored = false
364 desc.CanCollide = false
365 end
366 end
367 local hrp = clone:FindFirstChild("HumanoidRootPart")
368 if hrp then hrp.Anchored = true end
369 local hum = clone:FindFirstChildOfClass("Humanoid")
370 if hum then
371 hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
372 hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
373 end
374 return clone
375 end
376 end
377 return nil
378 end
379
380 local animCache = {}
381 local function resolveAnimId(catalogId)
382 if animCache[catalogId] then
383 return animCache[catalogId]
384 end
385 local okObj, objs = pcall(function()
386 return game:GetObjects("rbxassetid://" .. catalogId)
387 end)
388 if okObj and objs and objs[1] then
389 local root = objs[1]
390 local anim = root:IsA("Animation") and root or root:FindFirstChildOfClass("Animation", true)
391 if anim and anim.AnimationId ~= "" then
392 animCache[catalogId] = anim.AnimationId
393 return anim.AnimationId
394 end
395 end
396 return nil
397 end
398
399 local currentlyPlayingCard = nil
400 local activeTrack = nil
401
402 local function stopCurrentEmote()
403 if activeTrack then
404 pcall(function() activeTrack:Stop() end)
405 activeTrack = nil
406 end
407 if currentlyPlayingCard and currentlyPlayingCard.Parent then
408 local oldStroke = currentlyPlayingCard:FindFirstChildOfClass("UIStroke")
409 if oldStroke then
410 TweenService:Create(oldStroke, TweenInfo.new(0.2), {Color = COLORS.border}):Play()
411 end
412 end
413 currentlyPlayingCard = nil
414 nowPlaying.Visible = false
415 scrollFrame.Size = UDim2.new(1, -24, 1, -152)
416 end
417
418 stopBtn.MouseButton1Click:Connect(stopCurrentEmote)
419
420 local cardCounter = 0
421 local function createCatalogCard(item)
422 cardCounter = cardCounter + 1
423 local card = Instance.new("Frame")
424 card.Name = item.Name or ("Emote_" .. tostring(item.Id))
425 card.BackgroundColor3 = COLORS.card
426 card.BackgroundTransparency = 0.22
427 card.BorderSizePixel = 0
428 card.LayoutOrder = cardCounter
429 card.ZIndex = 2
430 card.Parent = scrollFrame
431 Instance.new("UICorner", card).CornerRadius = UDim.new(0, 9)
432
433 local cardStroke = Instance.new("UIStroke")
434 cardStroke.Color = COLORS.border
435 cardStroke.Thickness = 1
436 cardStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
437 cardStroke.Parent = card
438
439 local previewBox = Instance.new("Frame")
440 previewBox.Name = "PreviewBox"
441 previewBox.Size = UDim2.new(1, -12, 0, 78)
442 previewBox.Position = UDim2.new(0, 6, 0, 6)
443 previewBox.BackgroundColor3 = Color3.fromRGB(9, 10, 14)
444 previewBox.BackgroundTransparency = 0.2
445 previewBox.BorderSizePixel = 0
446 previewBox.ClipsDescendants = true
447 previewBox.ZIndex = 2
448 previewBox.Parent = card
449 Instance.new("UICorner", previewBox).CornerRadius = UDim.new(0, 7)
450
451 local thumb = Instance.new("ImageLabel")
452 thumb.Name = "Thumb"
453 thumb.Size = UDim2.new(1, 0, 1, 0)
454 thumb.BackgroundTransparency = 1
455 thumb.ScaleType = Enum.ScaleType.Fit
456 thumb.Image = "rbxthumb://type=Asset&id=" .. tostring(item.Id) .. "&w=150&h=150"
457 thumb.ZIndex = 2
458 thumb.Parent = previewBox
459
460 local previewStarted = false
461 local function startR15Preview()
462 if previewStarted then return end
463 previewStarted = true
464 task.spawn(function()
465 local animId = resolveAnimId(item.Id)
466 local rig = getR15PreviewRig()
467 if not animId or not rig or not card.Parent then return end
468
469 local viewport = Instance.new("ViewportFrame")
470 viewport.Name = "Preview"
471 viewport.Size = UDim2.new(1, 0, 1, 0)
472 viewport.BackgroundTransparency = 1
473 viewport.BorderSizePixel = 0
474 viewport.Ambient = Color3.fromRGB(165, 175, 195)
475 viewport.LightColor = Color3.fromRGB(255, 255, 255)
476 viewport.LightDirection = Vector3.new(-1, -1, 1)
477 viewport.ZIndex = 2
478 viewport.Parent = previewBox
479
480 local worldModel = Instance.new("WorldModel")
481 worldModel.Parent = viewport
482
483 local cam = Instance.new("Camera")
484 cam.CFrame = CFrame.new(Vector3.new(0, 0.4, -5.8), Vector3.new(0, 0.2, 0))
485 cam.FieldOfView = 38
486 cam.Parent = viewport
487 viewport.CurrentCamera = cam
488
489 rig:PivotTo(CFrame.new(0, 0, 0))
490 rig.Parent = worldModel
491
492 pcall(function()
493 local hum = rig:FindFirstChildOfClass("Humanoid")
494 local animator = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator", hum)
495 local anim = Instance.new("Animation")
496 anim.AnimationId = animId
497 local track = animator:LoadAnimation(anim)
498 track.Looped = true
499 track:Play()
500 end)
501
502 thumb.Visible = false
503 end)
504 end
505
506 local nameLabel = Instance.new("TextLabel")
507 nameLabel.Name = "EmoteName"
508 nameLabel.Size = UDim2.new(1, -8, 0, 20)
509 nameLabel.Position = UDim2.new(0, 4, 0, 88)
510 nameLabel.BackgroundTransparency = 1
511 nameLabel.Text = item.Name or "Emote"
512 nameLabel.Font = FONT_MEDIUM
513 nameLabel.TextSize = 13
514 nameLabel.TextColor3 = COLORS.text
515 nameLabel.TextTruncate = Enum.TextTruncate.AtEnd
516 nameLabel.ZIndex = 2
517 nameLabel.Parent = card
518
519 local priceText = (item.Price and item.Price > 0) and ("R$ " .. tostring(item.Price)) or "Free"
520 local subLabel = Instance.new("TextLabel")
521 subLabel.Name = "SubLabel"
522 subLabel.Size = UDim2.new(1, -8, 0, 16)
523 subLabel.Position = UDim2.new(0, 4, 0, 109)
524 subLabel.BackgroundTransparency = 1
525 subLabel.Text = priceText
526 subLabel.Font = FONT_REGULAR
527 subLabel.TextSize = 12
528 subLabel.TextColor3 = COLORS.subtext
529 subLabel.ZIndex = 2
530 subLabel.Parent = card
531
532 local clickBtn = Instance.new("TextButton")
533 clickBtn.Name = "ClickArea"
534 clickBtn.Size = UDim2.new(1, 0, 1, 0)
535 clickBtn.BackgroundTransparency = 1
536 clickBtn.Text = ""
537 clickBtn.ZIndex = 3
538 clickBtn.Parent = card
539
540 clickBtn.MouseEnter:Connect(function()
541 startR15Preview()
542 TweenService:Create(cardStroke, TweenInfo.new(0.15), {Color = COLORS.borderHover}):Play()
543 end)
544
545 clickBtn.MouseLeave:Connect(function()
546 local isPlaying = (currentlyPlayingCard == card)
547 TweenService:Create(cardStroke, TweenInfo.new(0.15), {Color = isPlaying and COLORS.blueAccent or COLORS.border}):Play()
548 end)
549
550 clickBtn.MouseButton1Click:Connect(function()
551 startR15Preview()
552 if currentlyPlayingCard == card then
553 stopCurrentEmote()
554 return
555 end
556
557 stopCurrentEmote()
558 currentlyPlayingCard = card
559 TweenService:Create(cardStroke, TweenInfo.new(0.15), {Color = COLORS.blueAccent}):Play()
560
561 nowPlaying.Visible = true
562 npLabel.Text = "Playing: " .. (item.Name or "Emote")
563 scrollFrame.Size = UDim2.new(1, -24, 1, -196)
564
565 task.spawn(function()
566 local animId = resolveAnimId(item.Id)
567 if not animId then return end
568 pcall(function()
569 local char = player.Character
570 if not char then return end
571 local hum = char:FindFirstChildOfClass("Humanoid")
572 if not hum then return end
573 local animator = hum:FindFirstChildOfClass("Animator") or Instance.new("Animator", hum)
574 local anim = Instance.new("Animation")
575 anim.AnimationId = animId
576 local track = animator:LoadAnimation(anim)
577 track.Priority = Enum.AnimationPriority.Action4
578 track.Looped = true
579 track:Play()
580 activeTrack = track
581 end)
582 end)
583 end)
584 end
585
586 -- Dynamic Catalog Query Engine
587 local queryToken = 0
588 local currentPages = nil
589 local isLoadingPage = false
590
591 local function clearGrid()
592 for _, child in ipairs(scrollFrame:GetChildren()) do
593 if child:IsA("Frame") then
594 child:Destroy()
595 end
596 end
597 cardCounter = 0
598 currentlyPlayingCard = nil
599 end
600
601 local function loadNextPage(token)
602 if isLoadingPage or not currentPages or token ~= queryToken then return end
603 isLoadingPage = true
604
605 task.spawn(function()
606 local page = currentPages:GetCurrentPage()
607 if token ~= queryToken then
608 isLoadingPage = false
609 return
610 end
611 for _, item in ipairs(page) do
612 if token ~= queryToken then break end
613 createCatalogCard(item)
614 end
615
616 if not currentPages.IsFinished and token == queryToken then
617 pcall(function() currentPages:AdvanceToNextPageAsync() end)
618 else
619 currentPages = nil
620 end
621 isLoadingPage = false
622 end)
623 end
624
625 local function startCatalogQuery(keyword, sortType)
626 queryToken = queryToken + 1
627 local token = queryToken
628 isLoadingPage = false
629 currentPages = nil
630 clearGrid()
631 scrollFrame.CanvasPosition = Vector2.new(0, 0)
632
633 task.spawn(function()
634 local okCat, pages = pcall(function()
635 local p = CatalogSearchParams.new()
636 p.AssetTypes = { Enum.AvatarAssetType.EmoteAnimation }
637 p.SortType = sortType
638 p.Limit = 120
639 if keyword and keyword ~= "" then
640 p.SearchKeyword = keyword
641 end
642 return AvatarEditorService:SearchCatalog(p)
643 end)
644 if token ~= queryToken then return end
645 if okCat and pages then
646 currentPages = pages
647 loadNextPage(token)
648 task.wait(0.2)
649 if token == queryToken and currentPages then
650 loadNextPage(token)
651 end
652 end
653 end)
654 end
655
656 scrollFrame:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
657 if currentPages and not isLoadingPage then
658 local maxY = math.max(0, scrollFrame.AbsoluteCanvasSize.Y - scrollFrame.AbsoluteWindowSize.Y)
659 if maxY > 0 and scrollFrame.CanvasPosition.Y >= maxY - 300 then
660 loadNextPage(queryToken)
661 end
662 end
663 end)
664
665 local searchSerial = 0
666 searchBox:GetPropertyChangedSignal("Text"):Connect(function()
667 searchSerial = searchSerial + 1
668 local mySerial = searchSerial
669 task.delay(0.35, function()
670 if mySerial == searchSerial then
671 startCatalogQuery(searchBox.Text, currentSort)
672 end
673 end)
674 end)
675
676 for _, info in pairs(sortButtons) do
677 info.btn.MouseButton1Click:Connect(function()
678 currentSort = info.sort
679 for _, other in pairs(sortButtons) do
680 local isSel = (other.btn == info.btn)
681 TweenService:Create(other.btn, TweenInfo.new(0.15), {
682 BackgroundColor3 = isSel and COLORS.whitePill or COLORS.surface,
683 BackgroundTransparency = isSel and 0 or 0.15,
684 }):Play()
685 TweenService:Create(other.stroke, TweenInfo.new(0.15), {
686 Color = isSel and COLORS.whitePill or COLORS.border,
687 }):Play()
688 other.btn.TextColor3 = isSel and COLORS.darkText or COLORS.subtext
689 end
690 startCatalogQuery(searchBox.Text, currentSort)
691 end)
692 end
693
694 -- Animate hex-wave background when UI is visible
695 local elapsed = 0
696 local mutateAccum = 0
697 RunService.RenderStepped:Connect(function(dt)
698 if not gui.Parent or not main.Visible then return end
699 elapsed = elapsed + dt
700 mutateAccum = mutateAccum + dt
701
702 for _, row in ipairs(hexRows) do
703 local wave = math.sin(elapsed * 0.9 + row.phase) * 0.55
704 row.grad.Offset = Vector2.new(wave, 0)
705 end
706
707 if mutateAccum >= 0.35 then
708 mutateAccum = 0
709 local pick = hexRows[math.random(1, #hexRows)]
710 if pick then
711 pick.label.Text = randomHexLine(26)
712 end
713 end
714 end)
715
716 -- F5 Toggle
717 local uiOpen = false
718 local function toggleUI()
719 uiOpen = not uiOpen
720 if uiOpen then
721 main.Visible = true
722 main.Size = UDim2.new(0, 368, 0, 0)
723 main.BackgroundTransparency = 0.25
724 TweenService:Create(main, TweenInfo.new(0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {
725 Size = UDim2.new(0, 368, 0, 530),
726 BackgroundTransparency = 0,
727 }):Play()
728 else
729 local tween = TweenService:Create(main, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
730 Size = UDim2.new(0, 368, 0, 0),
731 BackgroundTransparency = 0.25,
732 })
733 tween:Play()
734 tween.Completed:Connect(function()
735 if not uiOpen then
736 main.Visible = false
737 end
738 end)
739 end
740 end
741
742 UserInputService.InputBegan:Connect(function(input)
743 if UserInputService:GetFocusedTextBox() then return end
744 if input.KeyCode == Enum.KeyCode.F5 then
745 toggleUI()
746 end
747 end)
748
749 startCatalogQuery("", currentSort)
750 print("Emote Catalog edges fixed! Press F5.")
751end, debug.traceback)
752
753if not ok then
754 warn("EmoteHub error:", err)
755end