8599

Untitled

Jan 18th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.63 KB | None | 0 0
  1. --keybind to open is comma
  2. --made by Gi#7331
  3.  
  4. local IsStudio = false
  5.  
  6. local ContextActionService = game:GetService("ContextActionService")
  7. local HttpService = game:GetService("HttpService")
  8. local GuiService = game:GetService("GuiService")
  9. local CoreGui = game:GetService("CoreGui")
  10. local AvatarEditorService = game:GetService("AvatarEditorService")
  11. local Players = game:GetService("Players")
  12. local StarterGui = game:GetService("StarterGui")
  13. local UserInputService = game:GetService("UserInputService")
  14.  
  15. local Emotes = {}
  16. local function AddEmote(name: string, id: IntValue, price: IntValue?)
  17.     if not (name and id) then
  18.         return
  19.     end
  20.  
  21.     table.insert(Emotes, {
  22.         ["name"] = name,
  23.         ["id"] = id,
  24.         ["icon"] = "rbxthumb://type=Asset&id=".. id .."&w=150&h=150",
  25.         ["price"] = price or 0,
  26.         ["index"] = #Emotes + 1,
  27.         ["sort"] = {}
  28.     })
  29. end
  30. local CurrentSort = "newestfirst"
  31.  
  32. local FavoriteOff = "rbxassetid://10651060677"
  33. local FavoriteOn = "rbxassetid://10651061109"
  34. local FavoritedEmotes = {}
  35.  
  36. local ScreenGui = Instance.new("ScreenGui")
  37. ScreenGui.Name = "Emotes"
  38. ScreenGui.DisplayOrder = 2
  39. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  40. ScreenGui.ResetOnSpawn = false
  41. ScreenGui.Enabled = false
  42.  
  43. local BackFrame = Instance.new("Frame")
  44. BackFrame.Size = UDim2.new(0.9, 0, 0.5, 0)
  45. BackFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  46. BackFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
  47. BackFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY
  48. BackFrame.BackgroundTransparency = 1
  49. BackFrame.BorderSizePixel = 0
  50. BackFrame.Parent = ScreenGui
  51.  
  52. local EmoteName = Instance.new("TextLabel")
  53. EmoteName.Name = "EmoteName"
  54. EmoteName.TextScaled = true
  55. EmoteName.AnchorPoint = Vector2.new(0.5, 0.5)
  56. EmoteName.Position = UDim2.new(-0.1, 0, 0.5, 0)
  57. EmoteName.Size = UDim2.new(0.2, 0, 0.2, 0)
  58. EmoteName.SizeConstraint = Enum.SizeConstraint.RelativeYY
  59. EmoteName.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  60. EmoteName.TextColor3 = Color3.new(1, 1, 1)
  61. EmoteName.BorderSizePixel = 0
  62. EmoteName.Parent = BackFrame
  63.  
  64. local Corner = Instance.new("UICorner")
  65. Corner.Parent = EmoteName
  66.  
  67. local Loading = Instance.new("TextLabel", BackFrame)
  68. Loading.AnchorPoint = Vector2.new(0.5, 0.5)
  69. Loading.Text = "Loading..."
  70. Loading.TextColor3 = Color3.new(1, 1, 1)
  71. Loading.BackgroundColor3 = Color3.new(0, 0, 0)
  72. Loading.TextScaled = true
  73. Loading.BackgroundTransparency = 0.5
  74. Loading.Size = UDim2.fromScale(0.2, 0.1)
  75. Loading.Position = UDim2.fromScale(0.5, 0.2)
  76. Corner:Clone().Parent = Loading
  77.  
  78. local Frame = Instance.new("ScrollingFrame")
  79. Frame.Size = UDim2.new(1, 0, 1, 0)
  80. Frame.CanvasSize = UDim2.new(0, 0, 0, 0)
  81. Frame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  82. Frame.ScrollingDirection = Enum.ScrollingDirection.Y
  83. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  84. Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
  85. Frame.BackgroundTransparency = 1
  86. Frame.ScrollBarThickness = 5
  87. Frame.BorderSizePixel = 0
  88. Frame.MouseLeave:Connect(function()
  89.     EmoteName.Text = "Select an Emote"
  90. end)
  91. Frame.Parent = BackFrame
  92.  
  93. local Grid = Instance.new("UIGridLayout")
  94. Grid.CellSize = UDim2.new(0.105, 0, 0, 0)
  95. Grid.CellPadding = UDim2.new(0.006, 0, 0.006, 0)
  96. Grid.SortOrder = Enum.SortOrder.LayoutOrder
  97. Grid.Parent = Frame
  98.  
  99. local SortFrame = Instance.new("Frame")
  100. SortFrame.Visible = false
  101. SortFrame.BorderSizePixel = 0
  102. SortFrame.Position = UDim2.new(1, 5, -0.125, 0)
  103. SortFrame.Size = UDim2.new(0.2, 0, 0, 0)
  104. SortFrame.AutomaticSize = Enum.AutomaticSize.Y
  105. SortFrame.BackgroundTransparency = 1
  106. Corner:Clone().Parent = SortFrame
  107. SortFrame.Parent = BackFrame
  108.  
  109. local SortList = Instance.new("UIListLayout")
  110. SortList.Padding = UDim.new(0.02, 0)
  111. SortList.HorizontalAlignment = Enum.HorizontalAlignment.Center
  112. SortList.VerticalAlignment = Enum.VerticalAlignment.Top
  113. SortList.SortOrder = Enum.SortOrder.LayoutOrder
  114. SortList.Parent = SortFrame
  115.  
  116. local function SortEmotes()
  117.     for i,Emote in pairs(Emotes) do
  118.         local EmoteButton = Frame:FindFirstChild(Emote.id)
  119.         if not EmoteButton then
  120.             continue
  121.         end
  122.         local IsFavorited = table.find(FavoritedEmotes, Emote.id)
  123.         EmoteButton.LayoutOrder = Emote.sort[CurrentSort] + ((IsFavorited and 0) or #Emotes)
  124.         EmoteButton.number.Text = Emote.sort[CurrentSort]
  125.     end
  126. end
  127.  
  128. local function createsort(order, text, sort)
  129.     local CreatedSort = Instance.new("TextButton")
  130.     CreatedSort.SizeConstraint = Enum.SizeConstraint.RelativeXX
  131.     CreatedSort.Size = UDim2.new(1, 0, 0.2, 0)
  132.     CreatedSort.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  133.     CreatedSort.LayoutOrder = order
  134.     CreatedSort.TextColor3 = Color3.new(1, 1, 1)
  135.     CreatedSort.Text = text
  136.     CreatedSort.TextScaled = true
  137.     CreatedSort.BorderSizePixel = 0
  138.     Corner:Clone().Parent = CreatedSort
  139.     CreatedSort.Parent = SortFrame
  140.     CreatedSort.MouseButton1Click:Connect(function()
  141.         SortFrame.Visible = false
  142.         CurrentSort = sort
  143.         SortEmotes()
  144.     end)
  145.     return CreatedSort
  146. end
  147.  
  148. createsort(1, "Newest First", "newestfirst")
  149. createsort(2, "Oldest First", "oldestfirst")
  150. createsort(3, "Alphabetically First", "alphabeticfirst")
  151. createsort(4, "Alphabetically Last", "alphabeticlast")
  152. createsort(5, "Highest Price", "highestprice")
  153. createsort(6, "Lowest Price", "lowestprice")
  154.  
  155. local SortButton = Instance.new("TextButton")
  156. SortButton.BorderSizePixel = 0
  157. SortButton.AnchorPoint = Vector2.new(0.5, 0.5)
  158. SortButton.Position = UDim2.new(0.925, -5, -0.075, 0)
  159. SortButton.Size = UDim2.new(0.15, 0, 0.1, 0)
  160. SortButton.TextScaled = true
  161. SortButton.TextColor3 = Color3.new(1, 1, 1)
  162. SortButton.BackgroundColor3 = Color3.new(0, 0, 0)
  163. SortButton.BackgroundTransparency = 0.3
  164. SortButton.Text = "Sort"
  165. SortButton.MouseButton1Click:Connect(function()
  166.     SortFrame.Visible = not SortFrame.Visible
  167. end)
  168. Corner:Clone().Parent = SortButton
  169. SortButton.Parent = BackFrame
  170.  
  171. local CloseButton = Instance.new("TextButton")
  172. CloseButton.BorderSizePixel = 0
  173. CloseButton.AnchorPoint = Vector2.new(0.5, 0.5)
  174. CloseButton.Position = UDim2.new(0.075, 0, -0.075, 0)
  175. CloseButton.Size = UDim2.new(0.15, 0, 0.1, 0)
  176. CloseButton.TextScaled = true
  177. CloseButton.TextColor3 = Color3.new(1, 1, 1)
  178. CloseButton.BackgroundColor3 = Color3.new(0, 0, 0)
  179. CloseButton.BackgroundTransparency = 0.3
  180. CloseButton.Text = "Close"
  181. CloseButton.MouseButton1Click:Connect(function()
  182.     ScreenGui.Enabled = false
  183. end)
  184. Corner:Clone().Parent = CloseButton
  185. CloseButton.Parent = BackFrame
  186.  
  187. local SearchBar = Instance.new("TextBox")
  188. SearchBar.BorderSizePixel = 0
  189. SearchBar.AnchorPoint = Vector2.new(0.5, 0.5)
  190. SearchBar.Position = UDim2.new(0.5, 0, -0.075, 0)
  191. SearchBar.Size = UDim2.new(0.55, 0, 0.1, 0)
  192. SearchBar.TextScaled = true
  193. SearchBar.PlaceholderText = "Search"
  194. SearchBar.TextColor3 = Color3.new(1, 1, 1)
  195. SearchBar.BackgroundColor3 = Color3.new(0, 0, 0)
  196. SearchBar.BackgroundTransparency = 0.3
  197. SearchBar:GetPropertyChangedSignal("Text"):Connect(function()
  198.     local text = SearchBar.Text:lower()
  199.     local buttons = Frame:GetChildren()
  200.     if text ~= text:sub(1,50) then
  201.         SearchBar.Text = SearchBar.Text:sub(1,50)
  202.         text = SearchBar.Text:lower()
  203.     end
  204.     if text ~= ""  then
  205.         for i,button in pairs(buttons) do
  206.             if button:IsA("GuiButton") then
  207.                 local name = button:GetAttribute("name"):lower()
  208.                 if name:match(text) then
  209.                     button.Visible = true
  210.                 else
  211.                     button.Visible = false
  212.                 end
  213.             end
  214.         end
  215.     else
  216.         for i,button in pairs(buttons) do
  217.             if button:IsA("GuiButton") then
  218.                 button.Visible = true
  219.             end
  220.         end
  221.     end
  222. end)
  223. Corner:Clone().Parent = SearchBar
  224. SearchBar.Parent = BackFrame
  225.  
  226. local function openemotes(name, state, input)
  227.     if state == Enum.UserInputState.Begin then
  228.         ScreenGui.Enabled = not ScreenGui.Enabled
  229.     end
  230. end
  231.  
  232. if IsStudio then
  233.     ContextActionService:BindActionAtPriority(
  234.         "Emote Menu",
  235.         openemotes,
  236.         true,
  237.         2001,
  238.         Enum.KeyCode.Comma
  239.     )
  240. else
  241.     ContextActionService:BindCoreActionAtPriority(
  242.         "Emote Menu",
  243.         openemotes,
  244.         true,
  245.         2001,
  246.         Enum.KeyCode.Comma
  247.     )
  248. end
  249.  
  250. local inputconnect
  251. ScreenGui:GetPropertyChangedSignal("Enabled"):Connect(function()
  252.     if ScreenGui.Enabled == true then
  253.         EmoteName.Text = "Select an Emote"
  254.         SearchBar.Text = ""
  255.         SortFrame.Visible = false
  256.         GuiService:SetEmotesMenuOpen(false)
  257.         inputconnect = UserInputService.InputBegan:Connect(function(input, processed)
  258.             if not processed then
  259.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  260.                     ScreenGui.Enabled = false
  261.                 end
  262.             end
  263.         end)
  264.     else
  265.         inputconnect:Disconnect()
  266.     end
  267. end)
  268.  
  269. if not IsStudio then
  270.     GuiService.EmotesMenuOpenChanged:Connect(function(isopen)
  271.         if isopen then
  272.             ScreenGui.Enabled = false
  273.         end
  274.     end)
  275. end
  276.  
  277. GuiService.MenuOpened:Connect(function()
  278.     ScreenGui.Enabled = false
  279. end)
  280.  
  281. if not game:IsLoaded() then
  282.     game.Loaded:Wait()
  283. end
  284.  
  285. local LocalPlayer = Players.LocalPlayer
  286.  
  287. if IsStudio then
  288.     ScreenGui.Parent = LocalPlayer.PlayerGui
  289. else
  290.     --thanks inf yield
  291.     local SynV3 = syn and DrawingImmediate
  292.     if (not is_sirhurt_closure) and (not SynV3) and (syn and syn.protect_gui) then
  293.         syn.protect_gui(ScreenGui)
  294.         ScreenGui.Parent = CoreGui
  295.     elseif get_hidden_gui or gethui then
  296.         local hiddenUI = get_hidden_gui or gethui
  297.         ScreenGui.Parent = hiddenUI()
  298.     else
  299.         ScreenGui.Parent = CoreGui
  300.     end
  301. end
  302.  
  303.  
  304. local function SendNotification(title, text)
  305.     if (not IsStudio) and syn and syn.toast_notification then
  306.         syn.toast_notification({
  307.             Type = ToastType.Error,
  308.             Title = title,
  309.             Content = text
  310.         })
  311.     else
  312.         StarterGui:SetCore("SendNotification", {
  313.             Title = title,
  314.             Text = text
  315.         })
  316.     end
  317. end
  318.  
  319. local function HumanoidPlayEmote(humanoid, name, id)
  320.     if IsStudio then
  321.         return humanoid:PlayEmote(name)
  322.     else
  323.         return humanoid:PlayEmoteAndGetAnimTrackById(id)
  324.     end
  325. end
  326.  
  327. local function PlayEmote(name: string, id: IntValue)
  328.     ScreenGui.Enabled = false
  329.     SearchBar.Text = ""
  330.     local Humanoid = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
  331.     local Description = Humanoid and Humanoid:FindFirstChildOfClass("HumanoidDescription")
  332.     if not Description then
  333.         return
  334.     end
  335.     if LocalPlayer.Character.Humanoid.RigType ~= Enum.HumanoidRigType.R6 then
  336.         local succ, err = pcall(function()
  337.             HumanoidPlayEmote(Humanoid, name, id)
  338.         end)
  339.         if not succ then
  340.             Description:AddEmote(name, id)
  341.             HumanoidPlayEmote(Humanoid, name, id)
  342.         end
  343.     else
  344.         SendNotification(
  345.             "r6? lol",
  346.             "you gotta be r15 dude"
  347.         )
  348.     end
  349. end
  350.  
  351. local function WaitForChildOfClass(parent, class)
  352.     local child = parent:FindFirstChildOfClass(class)
  353.     while not child or child.ClassName ~= class do
  354.         child = parent.ChildAdded:Wait()
  355.     end
  356.     return child
  357. end
  358.  
  359. local params = CatalogSearchParams.new()
  360. params.AssetTypes = {Enum.AvatarAssetType.EmoteAnimation}
  361. params.SortType = Enum.CatalogSortType.RecentlyCreated
  362. params.SortAggregation = Enum.CatalogSortAggregation.AllTime
  363. params.IncludeOffSale = true
  364. params.CreatorName = "Roblox"
  365. params.Limit = 120
  366.  
  367. local function getCatalogPage()
  368.     local success, catalogPage = pcall(function()
  369.         return AvatarEditorService:SearchCatalog(params)
  370.     end)
  371.     if not success then
  372.         task.wait(5)
  373.         return getCatalogPage()
  374.     end
  375.     return catalogPage
  376. end
  377.  
  378. local catalogPage = getCatalogPage()
  379.  
  380. local pages = {}
  381.  
  382. while true do
  383.     local currentPage = catalogPage:GetCurrentPage()
  384.     table.insert(pages, currentPage)
  385.     if catalogPage.IsFinished then
  386.         break
  387.     end
  388.     local function AdvanceToNextPage()
  389.         local success = pcall(function()
  390.             catalogPage:AdvanceToNextPageAsync()
  391.         end)
  392.         if not success then
  393.             task.wait(5)
  394.             return AdvanceToNextPage()
  395.         end
  396.     end
  397.     AdvanceToNextPage()
  398. end
  399.  
  400. local totalEmotes = {}
  401. for _, page in pairs(pages) do
  402.     for _, emote in pairs(page) do
  403.         table.insert(totalEmotes, emote)
  404.     end
  405. end
  406.  
  407. for i, Emote in pairs(totalEmotes) do
  408.     AddEmote(Emote.Name, Emote.Id, Emote.Price)
  409. end
  410.  
  411. --unreleased emotes
  412. AddEmote("Arm Wave", 5915773155)
  413. AddEmote("Head Banging", 5915779725)
  414. AddEmote("Face Calisthenics", 9830731012)
  415.  
  416. --finished loading
  417. Loading:Destroy()
  418.  
  419. --sorting options setup
  420. table.sort(Emotes, function(a, b)
  421.     return a.index < b.index
  422. end)
  423. for i,v in pairs(Emotes) do
  424.     v.sort.newestfirst = i
  425. end
  426.  
  427. table.sort(Emotes, function(a, b)
  428.     return a.index > b.index
  429. end)
  430. for i,v in pairs(Emotes) do
  431.     v.sort.oldestfirst = i
  432. end
  433.  
  434. table.sort(Emotes, function(a, b)
  435.     return a.name:lower() < b.name:lower()
  436. end)
  437. for i,v in pairs(Emotes) do
  438.     v.sort.alphabeticfirst = i
  439. end
  440.  
  441. table.sort(Emotes, function(a, b)
  442.     return a.name:lower() > b.name:lower()
  443. end)
  444. for i,v in pairs(Emotes) do
  445.     v.sort.alphabeticlast = i
  446. end
  447.  
  448. table.sort(Emotes, function(a, b)
  449.     return a.price < b.price
  450. end)
  451. for i,v in pairs(Emotes) do
  452.     v.sort.lowestprice = i
  453. end
  454.  
  455. table.sort(Emotes, function(a, b)
  456.     return a.price > b.price
  457. end)
  458. for i,v in pairs(Emotes) do
  459.     v.sort.highestprice = i
  460. end
  461.  
  462.  
  463. local function IsFileFunc(...)
  464.     if IsStudio then
  465.         return
  466.     elseif isfile then
  467.         return isfile(...)
  468.     end
  469. end
  470.  
  471. local function WriteFileFunc(...)
  472.     if IsStudio then
  473.         return
  474.     elseif writefile then
  475.         return writefile(...)
  476.     end
  477. end
  478.  
  479. local function ReadFileFunc(...)
  480.     if IsStudio then
  481.         return
  482.     elseif readfile then
  483.         return readfile(...)
  484.     end
  485. end
  486.  
  487. if not IsStudio then
  488.     if IsFileFunc("FavoritedEmotes.txt") then
  489.         if not pcall(function()
  490.             FavoritedEmotes = HttpService:JSONDecode(ReadFileFunc("FavoritedEmotes.txt"))
  491.         end) then
  492.             FavoritedEmotes = {}
  493.         end
  494.     else
  495.         WriteFileFunc("FavoritedEmotes.txt", HttpService:JSONEncode(FavoritedEmotes))
  496.     end
  497.     local UpdatedFavorites = {}
  498.     for i,name in pairs(FavoritedEmotes) do
  499.         if typeof(name) == "string" then
  500.             for i,emote in pairs(Emotes) do
  501.                 if emote.name == name then
  502.                     table.insert(UpdatedFavorites, emote.id)
  503.                     break
  504.                 end
  505.             end
  506.         end
  507.     end
  508.     if #UpdatedFavorites ~= 0 then
  509.         FavoritedEmotes = UpdatedFavorites
  510.         WriteFileFunc("FavoritedEmotes.txt", HttpService:JSONEncode(FavoritedEmotes))
  511.     end
  512. end
  513.  
  514.  
  515. local function CharacterAdded(Character)
  516.     for i,v in pairs(Frame:GetChildren()) do
  517.         if not v:IsA("UIGridLayout") then
  518.             v:Destroy()
  519.         end
  520.     end
  521.     local Humanoid = WaitForChildOfClass(Character, "Humanoid")
  522.     local Description = Humanoid:WaitForChild("HumanoidDescription", 5) or Instance.new("HumanoidDescription", Humanoid)
  523.     local random = Instance.new("TextButton")
  524.     local Ratio = Instance.new("UIAspectRatioConstraint")
  525.     Ratio.AspectType = Enum.AspectType.ScaleWithParentSize
  526.     Ratio.Parent = random
  527.     random.LayoutOrder = 0
  528.     random.TextColor3 = Color3.new(1, 1, 1)
  529.     random.BorderSizePixel = 0
  530.     random.BackgroundTransparency = 0.5
  531.     random.BackgroundColor3 = Color3.new(0, 0, 0)
  532.     random.TextScaled = true
  533.     random.Text = "Random"
  534.     random:SetAttribute("name", "")
  535.     Corner:Clone().Parent = random
  536.     random.MouseButton1Click:Connect(function()
  537.         local randomemote = Emotes[math.random(1, #Emotes)]
  538.         PlayEmote(randomemote.name, randomemote.id)
  539.     end)
  540.     random.MouseEnter:Connect(function()
  541.         EmoteName.Text = "Random"
  542.     end)
  543.     random.Parent = Frame
  544.     for i,Emote in pairs(Emotes) do
  545.         Description:AddEmote(Emote.name, Emote.id)
  546.         local EmoteButton = Instance.new("ImageButton")
  547.         local IsFavorited = table.find(FavoritedEmotes, Emote.id)
  548.         EmoteButton.LayoutOrder = Emote.sort[CurrentSort] + ((IsFavorited and 0) or #Emotes)
  549.         EmoteButton.Name = Emote.id
  550.         EmoteButton:SetAttribute("name", Emote.name)
  551.         Corner:Clone().Parent = EmoteButton
  552.         EmoteButton.Image = Emote.icon
  553.         EmoteButton.BackgroundTransparency = 0.5
  554.         EmoteButton.BackgroundColor3 = Color3.new(0, 0, 0)
  555.         EmoteButton.BorderSizePixel = 0
  556.         Ratio:Clone().Parent = EmoteButton
  557.         local EmoteNumber = Instance.new("TextLabel")
  558.         EmoteNumber.Name = "number"
  559.         EmoteNumber.TextScaled = true
  560.         EmoteNumber.BackgroundTransparency = 1
  561.         EmoteNumber.TextColor3 = Color3.new(1, 1, 1)
  562.         EmoteNumber.BorderSizePixel = 0
  563.         EmoteNumber.AnchorPoint = Vector2.new(0.5, 0.5)
  564.         EmoteNumber.Size = UDim2.new(0.2, 0, 0.2, 0)
  565.         EmoteNumber.Position = UDim2.new(0.1, 0, 0.9, 0)
  566.         EmoteNumber.Text = Emote.sort[CurrentSort]
  567.         EmoteNumber.TextXAlignment = Enum.TextXAlignment.Center
  568.         EmoteNumber.TextYAlignment = Enum.TextYAlignment.Center
  569.         local UIStroke = Instance.new("UIStroke")
  570.         UIStroke.Transparency = 0.5
  571.         UIStroke.Parent = EmoteNumber
  572.         EmoteNumber.Parent = EmoteButton
  573.         EmoteButton.Parent = Frame
  574.         EmoteButton.MouseButton1Click:Connect(function()
  575.             PlayEmote(Emote.name, Emote.id)
  576.         end)
  577.         EmoteButton.MouseEnter:Connect(function()
  578.             EmoteName.Text = Emote.name
  579.         end)
  580.         local Favorite = Instance.new("ImageButton")
  581.         Favorite.Name = "favorite"
  582.         if table.find(FavoritedEmotes, Emote.id) then
  583.             Favorite.Image = FavoriteOn
  584.         else
  585.             Favorite.Image = FavoriteOff
  586.         end
  587.         Favorite.AnchorPoint = Vector2.new(0.5, 0.5)
  588.         Favorite.Size = UDim2.new(0.2, 0, 0.2, 0)
  589.         Favorite.Position = UDim2.new(0.9, 0, 0.9, 0)
  590.         Favorite.BorderSizePixel = 0
  591.         Favorite.BackgroundTransparency = 1
  592.         Favorite.Parent = EmoteButton
  593.         Favorite.MouseButton1Click:Connect(function()
  594.             local index = table.find(FavoritedEmotes, Emote.id)
  595.             if index then
  596.                 table.remove(FavoritedEmotes, index)
  597.                 Favorite.Image = FavoriteOff
  598.                 EmoteButton.LayoutOrder = Emote.sort[CurrentSort] + #Emotes
  599.             else
  600.                 table.insert(FavoritedEmotes, Emote.id)
  601.                 Favorite.Image = FavoriteOn
  602.                 EmoteButton.LayoutOrder = Emote.sort[CurrentSort]
  603.             end
  604.             WriteFileFunc("FavoritedEmotes.txt", HttpService:JSONEncode(FavoritedEmotes))
  605.         end)
  606.     end
  607.     for i=1,9 do
  608.         local EmoteButton = Instance.new("Frame")
  609.         EmoteButton.LayoutOrder = 2147483647
  610.         EmoteButton.Name = "filler"
  611.         EmoteButton.BackgroundTransparency = 1
  612.         EmoteButton.BorderSizePixel = 0
  613.         Ratio:Clone().Parent = EmoteButton
  614.         EmoteButton.Visible = true
  615.         EmoteButton.Parent = Frame
  616.         EmoteButton.MouseEnter:Connect(function()
  617.             EmoteName.Text = "Select an Emote"
  618.         end)
  619.     end
  620. end
  621.  
  622. if LocalPlayer.Character then
  623.     CharacterAdded(LocalPlayer.Character)
  624. end
  625. LocalPlayer.CharacterAdded:Connect(CharacterAdded)
  626.  
Add Comment
Please, Sign In to add comment