Mangle_DevCH

Free Emote 2

Aug 24th, 2025 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 42.32 KB | None | 0 0
  1. --[[
  2.     Source script taken from: https://github.com/Roblox/creator-docs/blob/main/content/en-us/characters/emotes.md
  3. ]]
  4.  
  5.  
  6. if _G.EmotesGUIRunning then
  7.     getgenv().Notify({
  8.         Title = '7yd7 | Emote',
  9.         Content = '⚠️ It works It actually works | Modified By Blox_Mochiz',
  10.         Duration = 5
  11.     })
  12.     return
  13. end
  14. _G.EmotesGUIRunning = true
  15.  
  16. loadstring(game:HttpGet("https://raw.githubusercontent.com/7yd7/Menu-7yd7/refs/heads/Script/GUIS/Off-site/Notify.lua"))()
  17.  
  18. getgenv().Notify({
  19.     Title = '7yd7 | Emote',
  20.     Content = '⚠️ Script loading...',
  21.     Duration = 5
  22. })
  23.  
  24. local Players = game:GetService("Players")
  25. local HttpService = game:GetService("HttpService")
  26. local RunService = game:GetService("RunService")
  27. local player = Players.LocalPlayer
  28. local character = player.Character or player.CharacterAdded:Wait()
  29. local humanoid = character:WaitForChild("Humanoid")
  30. local UserInputService = game:GetService("UserInputService")
  31. local CoreGui = game:GetService("CoreGui")
  32.  
  33. local emoteClickConnections = {}
  34. local isMonitoringClicks = false
  35. local currentTimer = nil
  36.  
  37. RunService.Heartbeat:Connect(function()
  38.     if player.Character and player.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
  39.         local errorMsg = CoreGui.RobloxGui.EmotesMenu.Children.ErrorMessage
  40.         if errorMsg.Visible then
  41.             errorMsg.ErrorText.Text = "Only r15 does not work r6"
  42.         end
  43.     end
  44. end)
  45.  
  46. function ErrorMessage(text, duration)
  47.  
  48.     if currentTimer then
  49.         task.cancel(currentTimer)
  50.         currentTimer = nil
  51.     end
  52.    
  53.     local errorMessage = CoreGui.RobloxGui.EmotesMenu.Children.ErrorMessage
  54.     local errorText = errorMessage.ErrorText
  55.    
  56.     errorText.Text = text
  57.    
  58.     errorMessage.Visible = true
  59.    
  60.     currentTimer = task.delay(duration, function()
  61.         errorMessage.Visible = false
  62.         currentTimer = nil
  63.     end)
  64. end
  65.  
  66. local function stopEmotes()
  67.     for _, track in ipairs(humanoid:GetPlayingAnimationTracks()) do
  68.         track:Stop()
  69.     end
  70. end
  71.  
  72. local emotesData = {}
  73. local currentPage = 1
  74. local itemsPerPage = 8
  75. local totalPages = 1
  76. local filteredEmotes = {}
  77. local isLoading = false
  78. local originalEmotesData = {}
  79. local totalEmotesLoaded = 0
  80. local scannedEmotes = {}
  81. local favoriteEmotes = {}
  82. local favoriteEnabled = false
  83. local favoriteFileName = "FavoriteEmotes.json"
  84. local emotesWalkEnabled = false
  85. local currentEmoteTrack = nil
  86. local currentCharacter = nil
  87. local isGUICreated = false
  88. local speedEmoteEnabled = false
  89. local speedEmoteConfigFile = "SpeedEmoteConfig.json"
  90.  
  91. local Under, UIListLayout, _1left, _9right, _4pages, _3TextLabel, _2Routenumber, Top, EmoteWalkButton, UICorner1,
  92.     UIListLayout_2, UICorner, Search, Favorite, UICorner2, UICorner_2, SpeedEmote, UICorner_4, SpeedBox
  93.  
  94. local defaultButtonImage = "rbxassetid://71408678974152"
  95. local enabledButtonImage = "rbxassetid://106798555684020"
  96.  
  97. local favoriteIconId = "rbxassetid://97307461910825"
  98. local notFavoriteIconId = "rbxassetid://124025954365505"
  99.  
  100. local function getCharacterAndHumanoid()
  101.     local character = player.Character
  102.     if not character then
  103.         return nil, nil
  104.     end
  105.     local humanoid = character:FindFirstChild("Humanoid")
  106.     if not humanoid then
  107.         return nil, nil
  108.     end
  109.     return character, humanoid
  110. end
  111.  
  112. local function checkEmotesMenuExists()
  113.     local coreGui = game:GetService("CoreGui")
  114.     local robloxGui = coreGui:FindFirstChild("RobloxGui")
  115.     if not robloxGui then
  116.         return false
  117.     end
  118.  
  119.     local emotesMenu = robloxGui:FindFirstChild("EmotesMenu")
  120.     if not emotesMenu then
  121.         return false
  122.     end
  123.  
  124.     local children = emotesMenu:FindFirstChild("Children")
  125.     if not children then
  126.         return false
  127.     end
  128.  
  129.     local main = children:FindFirstChild("Main")
  130.     if not main then
  131.         return false
  132.     end
  133.  
  134.     local emotesWheel = main:FindFirstChild("EmotesWheel")
  135.     if not emotesWheel then
  136.         return false
  137.     end
  138.  
  139.     return true, emotesWheel
  140. end
  141.  
  142. local function getBackgroundOverlay()
  143.     local success, result = pcall(function()
  144.         return game:GetService("CoreGui").RobloxGui.EmotesMenu.Children.Main.EmotesWheel.Back.Background
  145.                    .BackgroundCircleOverlay
  146.     end)
  147.     if success then
  148.         return result
  149.     end
  150.     return nil
  151. end
  152.  
  153. local function updateGUIColors()
  154.     local backgroundOverlay = getBackgroundOverlay()
  155.     if not backgroundOverlay then
  156.         return
  157.     end
  158.  
  159.     local bgColor = backgroundOverlay.BackgroundColor3
  160.     local bgTransparency = backgroundOverlay.BackgroundTransparency
  161.  
  162.     if _1left then
  163.         _1left.ImageColor3 = bgColor
  164.         _1left.ImageTransparency = bgTransparency
  165.     end
  166.  
  167.     if _9right then
  168.         _9right.ImageColor3 = bgColor
  169.         _9right.ImageTransparency = bgTransparency
  170.     end
  171.  
  172.     if _4pages then
  173.         _4pages.TextColor3 = bgColor
  174.         _4pages.TextTransparency = bgTransparency
  175.     end
  176.  
  177.     if _3TextLabel then
  178.         _3TextLabel.TextColor3 = bgColor
  179.         _3TextLabel.TextTransparency = bgTransparency
  180.     end
  181.  
  182.     if _2Routenumber then
  183.         _2Routenumber.TextColor3 = bgColor
  184.         _2Routenumber.TextTransparency = bgTransparency
  185.     end
  186.  
  187.     if Top then
  188.         Top.BackgroundColor3 = bgColor
  189.         Top.BackgroundTransparency = bgTransparency
  190.     end
  191.  
  192.     if EmoteWalkButton then
  193.         EmoteWalkButton.BackgroundColor3 = bgColor
  194.         EmoteWalkButton.BackgroundTransparency = bgTransparency
  195.     end
  196.  
  197.     if SpeedEmote then
  198.         SpeedEmote.BackgroundColor3 = bgColor
  199.         SpeedEmote.BackgroundTransparency = bgTransparency
  200.     end
  201.  
  202.     if SpeedBox then
  203.         SpeedBox.BackgroundColor3 = bgColor
  204.         SpeedBox.BackgroundTransparency = bgTransparency
  205.     end
  206.  
  207.     if Favorite then
  208.         Favorite.BackgroundColor3 = bgColor
  209.         Favorite.BackgroundTransparency = bgTransparency
  210.     end
  211. end
  212.  
  213. local function urlToId(animationId)
  214.     animationId = string.gsub(animationId, "http://www%.roblox%.com/asset/%?id=", "")
  215.     animationId = string.gsub(animationId, "rbxassetid://", "")
  216.     return animationId
  217. end
  218.  
  219. local function saveFavorites()
  220.     if writefile then
  221.         local jsonData = HttpService:JSONEncode(favoriteEmotes)
  222.         writefile(favoriteFileName, jsonData)
  223.     end
  224. end
  225.  
  226. local function loadFavorites()
  227.     if readfile and isfile and isfile(favoriteFileName) then
  228.         local success, result = pcall(function()
  229.             local fileContent = readfile(favoriteFileName)
  230.             return HttpService:JSONDecode(fileContent)
  231.         end)
  232.         if success and result then
  233.             favoriteEmotes = result
  234.         end
  235.     end
  236. end
  237.  
  238. local function loadSpeedEmoteConfig()
  239.     if readfile and isfile and isfile(speedEmoteConfigFile) then
  240.         local success, result = pcall(function()
  241.             local fileContent = readfile(speedEmoteConfigFile)
  242.             return HttpService:JSONDecode(fileContent)
  243.         end)
  244.         if success and result then
  245.             speedEmoteEnabled = result.Enabled or false
  246.             if SpeedBox then
  247.                 SpeedBox.Text = tostring(result.SpeedValue or 1)
  248.                 SpeedBox.Visible = speedEmoteEnabled
  249.             end
  250.         end
  251.     end
  252. end
  253.  
  254. local function extractAssetId(imageUrl)
  255.     local assetId = string.match(imageUrl, "Asset&id=(%d+)")
  256.     return assetId
  257. end
  258.  
  259. local function getEmoteName(assetId)
  260.     local success, productInfo = pcall(function()
  261.         return game:GetService("MarketplaceService"):GetProductInfo(tonumber(assetId))
  262.     end)
  263.    
  264.     if success and productInfo then
  265.         return productInfo.Name
  266.     else
  267.         return "Unknown Emote"
  268.     end
  269. end
  270.  
  271. local function isInFavorites(emoteId)
  272.     for _, favorite in pairs(favoriteEmotes) do
  273.         if favorite.id == tostring(emoteId) then
  274.             return true
  275.         end
  276.     end
  277.     return false
  278. end
  279.  
  280. local function updateEmotes()
  281.     local character, humanoid = getCharacterAndHumanoid()
  282.     if not character or not humanoid then
  283.         return
  284.     end
  285.  
  286.     local humanoidDescription = humanoid.HumanoidDescription
  287.     if not humanoidDescription then
  288.         return
  289.     end
  290.  
  291.     local currentPageEmotes = {}
  292.     local emoteTable = {}
  293.     local equippedEmotes = {}
  294.  
  295.     local favoritesToUse = _G.filteredFavoritesForDisplay or favoriteEmotes
  296.     local hasFavorites = #favoritesToUse > 0
  297.     local favoritePagesCount = hasFavorites and math.ceil(#favoritesToUse / itemsPerPage) or 0
  298.     local isInFavoritesPages = currentPage <= favoritePagesCount
  299.  
  300.     if isInFavoritesPages and hasFavorites then
  301.         local startIndex = (currentPage - 1) * itemsPerPage + 1
  302.         local endIndex = math.min(startIndex + itemsPerPage - 1, #favoritesToUse)
  303.  
  304.         for i = startIndex, endIndex do
  305.             if favoritesToUse[i] then
  306.                 table.insert(currentPageEmotes, {
  307.                     id = tonumber(favoritesToUse[i].id),
  308.                     name = favoritesToUse[i].name
  309.                 })
  310.             end
  311.         end
  312.     else
  313.         local normalEmotes = {}
  314.         for _, emote in pairs(filteredEmotes) do
  315.             if not isInFavorites(emote.id) then
  316.                 table.insert(normalEmotes, emote)
  317.             end
  318.         end
  319.  
  320.         local adjustedPage = currentPage - favoritePagesCount
  321.         local startIndex = (adjustedPage - 1) * itemsPerPage + 1
  322.         local endIndex = math.min(startIndex + itemsPerPage - 1, #normalEmotes)
  323.  
  324.         for i = startIndex, endIndex do
  325.             if normalEmotes[i] then
  326.                 table.insert(currentPageEmotes, normalEmotes[i])
  327.             end
  328.         end
  329.     end
  330.  
  331.     for _, emote in pairs(currentPageEmotes) do
  332.         local emoteName = emote.name
  333.         local emoteId = emote.id
  334.         emoteTable[emoteName] = {emoteId}
  335.         table.insert(equippedEmotes, emoteName)
  336.     end
  337.  
  338.     humanoidDescription:SetEmotes(emoteTable)
  339.     humanoidDescription:SetEquippedEmotes(equippedEmotes)
  340. end
  341.  
  342. local function calculateTotalPages()
  343.     local favoritesToUse = _G.filteredFavoritesForDisplay or favoriteEmotes
  344.     local hasFavorites = #favoritesToUse > 0
  345.     local normalEmotesCount = 0
  346.  
  347.     for _, emote in pairs(filteredEmotes) do
  348.         if not isInFavorites(emote.id) then
  349.             normalEmotesCount = normalEmotesCount + 1
  350.         end
  351.     end
  352.  
  353.     local pages = 0
  354.  
  355.     if hasFavorites then
  356.         pages = pages + math.ceil(#favoritesToUse / itemsPerPage)
  357.     end
  358.  
  359.     if normalEmotesCount > 0 then
  360.         pages = pages + math.ceil(normalEmotesCount / itemsPerPage)
  361.     end
  362.  
  363.     return math.max(pages, 1)
  364. end
  365.  
  366. local function isGivenAnimation(animationHolder, animationId)
  367.     for _, animation in animationHolder:GetChildren() do
  368.         if animation:IsA("Animation") and urlToId(animation.AnimationId) == animationId then
  369.             return true
  370.         end
  371.     end
  372.     return false
  373. end
  374.  
  375. local function isDancing(character, animationTrack)
  376.     local animationId = urlToId(animationTrack.Animation.AnimationId)
  377.     for _, animationHolder in character.Animate:GetChildren() do
  378.         if animationHolder:IsA("StringValue") then
  379.             local sharesAnimationId = isGivenAnimation(animationHolder, animationId)
  380.             if sharesAnimationId then
  381.                 return false
  382.             end
  383.         end
  384.     end
  385.     return true
  386. end
  387.  
  388. local function createGUIElements()
  389.     local exists, emotesWheel = checkEmotesMenuExists()
  390.     if not exists then
  391.         return false
  392.     end
  393.  
  394.     if emotesWheel:FindFirstChild("Under") then
  395.         emotesWheel.Under:Destroy()
  396.     end
  397.     if emotesWheel:FindFirstChild("Top") then
  398.         emotesWheel.Top:Destroy()
  399.     end
  400.     if emotesWheel:FindFirstChild("EmoteWalkButton") then
  401.         emotesWheel.EmoteWalkButton:Destroy()
  402.     end
  403.     if emotesWheel:FindFirstChild("Favorite") then
  404.         emotesWheel.Favorite:Destroy()
  405.     end
  406.     if emotesWheel:FindFirstChild("SpeedEmote") then
  407.         emotesWheel.SpeedEmote:Destroy()
  408.     end
  409.     if emotesWheel:FindFirstChild("SpeedBox") then
  410.         emotesWheel.SpeedBox:Destroy()
  411.     end
  412.  
  413.     Under = Instance.new("Frame")
  414.     UIListLayout = Instance.new("UIListLayout")
  415.     _1left = Instance.new("ImageButton")
  416.     _9right = Instance.new("ImageButton")
  417.     _4pages = Instance.new("TextLabel")
  418.     _3TextLabel = Instance.new("TextLabel")
  419.     _2Routenumber = Instance.new("TextBox")
  420.     EmoteWalkButton = Instance.new("ImageButton")
  421.     UICorner1 = Instance.new("UICorner")
  422.     Top = Instance.new("Frame")
  423.     UIListLayout_2 = Instance.new("UIListLayout")
  424.     UICorner = Instance.new("UICorner")
  425.     Search = Instance.new("TextBox")
  426.     Favorite = Instance.new("ImageButton")
  427.     UICorner2 = Instance.new("UICorner")
  428.     SpeedBox = Instance.new("TextBox")
  429.     UICorner_4 = Instance.new("UICorner")
  430.     SpeedEmote = Instance.new("ImageButton")
  431.     UICorner_2 = Instance.new("UICorner")
  432.  
  433.     Under.Name = "Under"
  434.     Under.Parent = emotesWheel
  435.     Under.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  436.     Under.BackgroundTransparency = 1.000
  437.     Under.BorderColor3 = Color3.fromRGB(0, 0, 0)
  438.     Under.BorderSizePixel = 0
  439.     Under.Position = UDim2.new(0.129999995, 0, 1, 0)
  440.     Under.Size = UDim2.new(0.737500012, 0, 0.132499993, 0)
  441.  
  442.     UIListLayout.Parent = Under
  443.     UIListLayout.FillDirection = Enum.FillDirection.Horizontal
  444.     UIListLayout.VerticalAlignment = Enum.VerticalAlignment.Center
  445.  
  446.     _1left.Name = "1left"
  447.     _1left.Parent = Under
  448.     _1left.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  449.     _1left.BackgroundTransparency = 1.000
  450.     _1left.BorderColor3 = Color3.fromRGB(0, 0, 0)
  451.     _1left.BorderSizePixel = 0
  452.     _1left.Position = UDim2.new(0.0289389063, 0, -0.0849056691, 0)
  453.     _1left.Rotation = 7456.000
  454.     _1left.Size = UDim2.new(0.169491529, 0, 0.94339627, 0)
  455.     _1left.Image = "rbxassetid://93111945058621"
  456.     _1left.ImageColor3 = Color3.fromRGB(0, 0, 0)
  457.     _1left.ImageTransparency = 0.400
  458.  
  459.     _9right.Name = "9right"
  460.     _9right.Parent = Under
  461.     _9right.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  462.     _9right.BackgroundTransparency = 1.000
  463.     _9right.BorderColor3 = Color3.fromRGB(0, 0, 0)
  464.     _9right.BorderSizePixel = 0
  465.     _9right.Position = UDim2.new(0.0289389063, 0, -0.0849056691, 0)
  466.     _9right.Rotation = 7456.000
  467.     _9right.Size = UDim2.new(0.169491529, 0, 0.94339627, 0)
  468.     _9right.Image = "rbxassetid://107938916240738"
  469.     _9right.ImageColor3 = Color3.fromRGB(0, 0, 0)
  470.     _9right.ImageTransparency = 0.400
  471.  
  472.     _4pages.Name = "4pages"
  473.     _4pages.Parent = Under
  474.     _4pages.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  475.     _4pages.BackgroundTransparency = 1.000
  476.     _4pages.BorderColor3 = Color3.fromRGB(0, 0, 0)
  477.     _4pages.BorderSizePixel = 0
  478.     _4pages.Position = UDim2.new(0.630225062, 0, 0.188679263, 0)
  479.     _4pages.Size = UDim2.new(0.159322038, 0, 0.811320841, 0)
  480.     _4pages.Font = Enum.Font.SourceSansBold
  481.     _4pages.Text = "1"
  482.     _4pages.TextColor3 = Color3.fromRGB(0, 0, 0)
  483.     _4pages.TextScaled = true
  484.     _4pages.TextSize = 14.000
  485.     _4pages.TextTransparency = 0.400
  486.     _4pages.TextWrapped = true
  487.  
  488.     _3TextLabel.Name = "3TextLabel"
  489.     _3TextLabel.Parent = Under
  490.     _3TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  491.     _3TextLabel.BackgroundTransparency = 1.000
  492.     _3TextLabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
  493.     _3TextLabel.BorderSizePixel = 0
  494.     _3TextLabel.Position = UDim2.new(0.363344043, 0, 0.0283018891, 0)
  495.     _3TextLabel.Size = UDim2.new(0.338983059, 0, 0.94339627, 0)
  496.     _3TextLabel.Font = Enum.Font.SourceSansBold
  497.     _3TextLabel.Text = " ------ "
  498.     _3TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  499.     _3TextLabel.TextScaled = true
  500.     _3TextLabel.TextSize = 14.000
  501.     _3TextLabel.TextTransparency = 0.400
  502.     _3TextLabel.TextWrapped = true
  503.  
  504.     _2Routenumber.Name = "2Route-number"
  505.     _2Routenumber.Parent = Under
  506.     _2Routenumber.Active = true
  507.     _2Routenumber.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  508.     _2Routenumber.BackgroundTransparency = 1.000
  509.     _2Routenumber.BorderColor3 = Color3.fromRGB(0, 0, 0)
  510.     _2Routenumber.BorderSizePixel = 0
  511.     _2Routenumber.Position = UDim2.new(0.138263673, 0, 0.0283018891, 0)
  512.     _2Routenumber.Selectable = true
  513.     _2Routenumber.Size = UDim2.new(0.159322038, 0, 0.811320841, 0)
  514.     _2Routenumber.Font = Enum.Font.SourceSansBold
  515.     _2Routenumber.PlaceholderColor3 = Color3.fromRGB(0, 0, 0)
  516.     _2Routenumber.Text = "1"
  517.     _2Routenumber.TextColor3 = Color3.fromRGB(0, 0, 0)
  518.     _2Routenumber.TextScaled = true
  519.     _2Routenumber.TextSize = 14.000
  520.     _2Routenumber.TextStrokeColor3 = Color3.fromRGB(255, 255, 255)
  521.     _2Routenumber.TextTransparency = 0.400
  522.     _2Routenumber.TextWrapped = true
  523.  
  524.     Top.Name = "Top"
  525.     Top.Parent = emotesWheel
  526.     Top.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  527.     Top.BackgroundTransparency = 0.400
  528.     Top.BorderColor3 = Color3.fromRGB(0, 0, 0)
  529.     Top.BorderSizePixel = 0
  530.     Top.Position = UDim2.new(0.127499998, 0, -0.109999999, 0)
  531.     Top.Size = UDim2.new(0.737500012, 0, 0.0949999914, 0)
  532.  
  533.     UIListLayout_2.Parent = Top
  534.     UIListLayout_2.FillDirection = Enum.FillDirection.Horizontal
  535.     UIListLayout_2.HorizontalAlignment = Enum.HorizontalAlignment.Center
  536.     UIListLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  537.     UIListLayout_2.VerticalAlignment = Enum.VerticalAlignment.Center
  538.  
  539.     UICorner.CornerRadius = UDim.new(0, 20)
  540.     UICorner.Parent = Top
  541.  
  542.     Search.Name = "Search"
  543.     Search.Parent = Top
  544.     Search.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  545.     Search.BackgroundTransparency = 1.000
  546.     Search.BorderColor3 = Color3.fromRGB(0, 0, 0)
  547.     Search.Position = UDim2.new(0.0677966103, 0, 0)
  548.     Search.Size = UDim2.new(0.864406765, 0, 0.81578958, 0)
  549.     Search.Font = Enum.Font.SourceSansBold
  550.     Search.PlaceholderText = "Search"
  551.     Search.Text = ""
  552.     Search.TextColor3 = Color3.fromRGB(255, 255, 255)
  553.     Search.TextScaled = true
  554.     Search.TextSize = 14.000
  555.     Search.TextWrapped = true
  556.  
  557.     EmoteWalkButton.Name = "EmoteWalkButton"
  558.     EmoteWalkButton.Parent = emotesWheel
  559.     EmoteWalkButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  560.     EmoteWalkButton.BackgroundTransparency = 0.400
  561.     EmoteWalkButton.BorderColor3 = Color3.fromRGB(0, 0, 0)
  562.     EmoteWalkButton.BorderSizePixel = 0
  563.     EmoteWalkButton.Position = UDim2.new(0.889999986, 0, -0.107500002, 0)
  564.     EmoteWalkButton.Size = UDim2.new(0.0874999985, 0, 0.0874999985, 0)
  565.     EmoteWalkButton.Image = defaultButtonImage
  566.  
  567.     UICorner1.CornerRadius = UDim.new(0, 10)
  568.     UICorner1.Parent = EmoteWalkButton
  569.  
  570.     Favorite.Name = "Favorite"
  571.     Favorite.Parent = emotesWheel
  572.     Favorite.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  573.     Favorite.BackgroundTransparency = 0.400
  574.     Favorite.BorderColor3 = Color3.fromRGB(0, 0, 0)
  575.     Favorite.BorderSizePixel = 0
  576.     Favorite.Position = UDim2.new(0.0189999994, 0, -0.108000003, 0)
  577.     Favorite.Size = UDim2.new(0.0874999985, 0, 0.0874999985, 0)
  578.     Favorite.Image = "rbxassetid://124025954365505"
  579.  
  580.     UICorner2.CornerRadius = UDim.new(0, 10)
  581.     UICorner2.Parent = Favorite
  582.  
  583.     SpeedBox.Name = "SpeedBox"
  584.     SpeedBox.Parent = emotesWheel
  585.     SpeedBox.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  586.     SpeedBox.BackgroundTransparency = 0.400
  587.     SpeedBox.BorderColor3 = Color3.fromRGB(0, 0, 0)
  588.     SpeedBox.BorderSizePixel = 0
  589.     SpeedBox.Position = UDim2.new(0.0189999398, 0, -0.000499992399, 0)
  590.     SpeedBox.Size = UDim2.new(0.0874999985, 0, 0.0874999985, 0)
  591.     SpeedBox.Visible = false
  592.     SpeedBox.Font = Enum.Font.SourceSansBold
  593.     SpeedBox.PlaceholderColor3 = Color3.fromRGB(178, 178, 178)
  594.     SpeedBox.Text = "1"
  595.     SpeedBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  596.     SpeedBox.TextScaled = true
  597.     SpeedBox.TextWrapped = true
  598.     SpeedBox:GetPropertyChangedSignal("Text"):Connect(function()
  599.        SpeedBox.Text = SpeedBox.Text:gsub("[^%d.]", "")
  600.     end)
  601.     SpeedBox.ZIndex = 2
  602.  
  603.     UICorner_4.CornerRadius = UDim.new(0, 10)
  604.     UICorner_4.Parent = SpeedBox
  605.  
  606.     SpeedEmote.Name = "SpeedEmote"
  607.     SpeedEmote.Parent = emotesWheel
  608.     SpeedEmote.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  609.     SpeedEmote.BackgroundTransparency = 0.400
  610.     SpeedEmote.BorderColor3 = Color3.fromRGB(0, 0, 0)
  611.     SpeedEmote.BorderSizePixel = 0
  612.     SpeedEmote.Position = UDim2.new(0.888999999, 0, -0, 0)
  613.     SpeedEmote.Size = UDim2.new(0.0874999985, 0, 0.0874999985, 0)
  614.     SpeedEmote.Image = "rbxassetid://116056570415896"
  615.     SpeedEmote.ZIndex = 2
  616.  
  617.     UICorner_2.CornerRadius = UDim.new(0, 10)
  618.     UICorner_2.Parent = SpeedEmote
  619.  
  620.     loadSpeedEmoteConfig()
  621.  
  622.     connectEvents()
  623.     isGUICreated = true
  624.     updateGUIColors()
  625.     return true
  626. end
  627.  
  628. local function updatePageDisplay()
  629.     if _4pages and _2Routenumber then
  630.         _4pages.Text = tostring(totalPages)
  631.         _2Routenumber.Text = tostring(currentPage)
  632.     end
  633. end
  634.  
  635. local function updateFavoriteIcon(imageLabel, assetId, isFavorite)
  636.     local favoriteIcon = imageLabel:FindFirstChild("FavoriteIcon")
  637.    
  638.     if not favoriteIcon then
  639.         favoriteIcon = Instance.new("ImageLabel")
  640.         favoriteIcon.Name = "FavoriteIcon"
  641.         favoriteIcon.Size = UDim2.new(0.3, 0, 0.3, 0)
  642.         favoriteIcon.Position = UDim2.new(0.7, 0, 0, 0)
  643.         favoriteIcon.AnchorPoint = Vector2.new(0, 0)
  644.         favoriteIcon.BackgroundTransparency = 1
  645.         favoriteIcon.ZIndex = imageLabel.ZIndex + 5
  646.         favoriteIcon.ScaleType = Enum.ScaleType.Fit
  647.         favoriteIcon.Parent = imageLabel
  648.     end
  649.    
  650.     if isFavorite then
  651.         favoriteIcon.Image = favoriteIconId
  652.     else
  653.         favoriteIcon.Image = notFavoriteIconId
  654.     end
  655. end
  656.  
  657. local function updateAllFavoriteIcons()
  658.     local success, frontFrame = pcall(function()
  659.         return game:GetService("CoreGui").RobloxGui.EmotesMenu.Children.Main.EmotesWheel.Front.EmotesButtons
  660.     end)
  661.    
  662.     if success and frontFrame then
  663.         for _, child in pairs(frontFrame:GetChildren()) do
  664.             if child:IsA("ImageLabel") and child.Image ~= "" then
  665.                 local imageUrl = child.Image
  666.                 local assetId = extractAssetId(imageUrl)
  667.                
  668.                 if assetId then
  669.                     local isFavorite = isInFavorites(assetId)
  670.                     updateFavoriteIcon(child, assetId, isFavorite)
  671.                 end
  672.             end
  673.         end
  674.     end
  675. end
  676.  
  677.  
  678. local function toggleFavorite(emoteId, emoteName)
  679.     local found = false
  680.     local index = 0
  681.  
  682.     for i, fav in pairs(favoriteEmotes) do
  683.         if fav.id == emoteId then
  684.             found = true
  685.             index = i
  686.             break
  687.         end
  688.     end
  689.  
  690.     if found then
  691.         table.remove(favoriteEmotes, index)
  692.         getgenv().Notify({
  693.             Title = '7yd7 | Favorite System',
  694.             Content = '🗑️ Removed "' .. emoteName .. '" from favorites',
  695.             Duration = 3
  696.         })
  697.     else
  698.         table.insert(favoriteEmotes, {
  699.             id = emoteId,
  700.             name = emoteName .. " - ⭐"
  701.         })
  702.         getgenv().Notify({
  703.             Title = '7yd7 | Favorite System',
  704.             Content = '✅ Added "' .. emoteName .. '" to favorites',
  705.             Duration = 3
  706.         })
  707.     end
  708.  
  709.     saveFavorites()
  710.     totalPages = calculateTotalPages()
  711.     updatePageDisplay()
  712.     updateEmotes()
  713.    
  714.     updateAllFavoriteIcons()
  715. end
  716.  
  717. local function setupEmoteClickDetection()
  718.     if isMonitoringClicks then
  719.         return
  720.     end
  721.    
  722.     local function monitorEmotes()
  723.         while favoriteEnabled do
  724.             local success, frontFrame = pcall(function()
  725.                 return game:GetService("CoreGui").RobloxGui.EmotesMenu.Children.Main.EmotesWheel.Front.EmotesButtons
  726.             end)
  727.            
  728.             if success and frontFrame then
  729.                 for _, connection in pairs(emoteClickConnections) do
  730.                     if connection then
  731.                         connection:Disconnect()
  732.                     end
  733.                 end
  734.                 emoteClickConnections = {}
  735.                
  736.                 for _, child in pairs(frontFrame:GetChildren()) do
  737.                     if child:IsA("ImageLabel") and child.Image ~= "" then
  738.                         local clickDetector = child:FindFirstChild("ClickDetector") or Instance.new("TextButton")
  739.                         clickDetector.Name = "ClickDetector"
  740.                         clickDetector.Size = UDim2.new(1, 0, 1, 0)
  741.                         clickDetector.Position = UDim2.new(0, 0, 0, 0)
  742.                         clickDetector.BackgroundTransparency = 1
  743.                         clickDetector.Text = ""
  744.                         clickDetector.ZIndex = child.ZIndex + 1
  745.                         clickDetector.Parent = child
  746.                        
  747.                         local imageUrl = child.Image
  748.                         local assetId = extractAssetId(imageUrl)
  749.                         if assetId then
  750.                             local isFavorite = isInFavorites(assetId)
  751.                             updateFavoriteIcon(child, assetId, isFavorite)
  752.                         end
  753.                        
  754.                         local connection = clickDetector.MouseButton1Click:Connect(function()
  755.                             if favoriteEnabled then
  756.                                 if assetId then
  757.                                     local emoteName = getEmoteName(assetId)
  758.                                     toggleFavorite(assetId, emoteName)
  759.                                 end
  760.                             end
  761.                         end)
  762.                        
  763.                         table.insert(emoteClickConnections, connection)
  764.                     end
  765.                 end
  766.             end
  767.            
  768.             task.wait(0.1)
  769.         end
  770.        
  771.         for _, connection in pairs(emoteClickConnections) do
  772.             if connection then
  773.                 connection:Disconnect()
  774.             end
  775.         end
  776.         emoteClickConnections = {}
  777.         isMonitoringClicks = false
  778.     end
  779.    
  780.     if favoriteEnabled then
  781.         isMonitoringClicks = true
  782.         task.spawn(monitorEmotes)
  783.     end
  784. end
  785.  
  786. local function stopEmoteClickDetection()
  787.     isMonitoringClicks = false
  788.    
  789.     for _, connection in pairs(emoteClickConnections) do
  790.         if connection then
  791.             connection:Disconnect()
  792.         end
  793.     end
  794.     emoteClickConnections = {}
  795.    
  796.     local success, frontFrame = pcall(function()
  797.         return game:GetService("CoreGui").RobloxGui.EmotesMenu.Children.Main.EmotesWheel.Front.EmotesButtons
  798.     end)
  799.    
  800.     if success and frontFrame then
  801.         for _, child in pairs(frontFrame:GetChildren()) do
  802.             if child:IsA("ImageLabel") then
  803.                 local clickDetector = child:FindFirstChild("ClickDetector")
  804.                 if clickDetector then
  805.                     clickDetector:Destroy()
  806.                 end
  807.                
  808.                 local favoriteIcon = child:FindFirstChild("FavoriteIcon")
  809.                 if favoriteIcon then
  810.                     favoriteIcon:Destroy()
  811.                 end
  812.             end
  813.         end
  814.     end
  815. end
  816.  
  817.  
  818. local function fetchAllEmotes()
  819.     if isLoading then
  820.         return
  821.     end
  822.     isLoading = true
  823.     emotesData = {}
  824.     totalEmotesLoaded = 0
  825.  
  826.     local success, result = pcall(function()
  827.         local jsonContent = game:HttpGet("https://raw.githubusercontent.com/7yd7/sniper-Emote/refs/heads/test/EmoteSniper.json")
  828.        
  829.         if jsonContent and jsonContent ~= "" then
  830.             local data = HttpService:JSONDecode(jsonContent)
  831.             return data.data or {}
  832.         else
  833.             return nil
  834.         end
  835.     end)
  836.  
  837.     if success and result then
  838.         for _, item in pairs(result) do
  839.             local emoteData = {
  840.                 id = tonumber(item.id),
  841.                 name = item.name or ("Emote_" .. (item.id or "Unknown"))
  842.             }
  843.             if emoteData.id and emoteData.id > 0 then
  844.                 table.insert(emotesData, emoteData)
  845.                 totalEmotesLoaded = totalEmotesLoaded + 1
  846.             end
  847.         end
  848.     else
  849.         emotesData = {
  850.             {id = 3360686498, name = "Stadium"},
  851.             {id = 3360692915, name = "Tilt"},
  852.             {id = 3576968026, name = "Shrug"},
  853.             {id = 3360689775, name = "Salute"}
  854.         }
  855.         totalEmotesLoaded = #emotesData
  856.     end
  857.  
  858.     originalEmotesData = emotesData
  859.     filteredEmotes = emotesData
  860.  
  861.     totalPages = calculateTotalPages()
  862.     currentPage = 1
  863.     updatePageDisplay()
  864.     updateEmotes()
  865.    
  866.     getgenv().Notify({
  867.         Title = '7yd7 | Emote',
  868.         Content = "🎉 Loaded Successfully! Total Emotes: " .. totalEmotesLoaded,
  869.         Duration = 5
  870.     })
  871.    
  872.     isLoading = false
  873. end
  874.  
  875. local function searchEmotes(searchTerm)
  876.     if isLoading then
  877.         getgenv().Notify({
  878.             Title = '7yd7 | Emote',
  879.             Content = '⚠️ Loading please wait...',
  880.             Duration = 5
  881.         })
  882.         return
  883.     end
  884.  
  885.     searchTerm = searchTerm:lower()
  886.  
  887.     if searchTerm == "" then
  888.         filteredEmotes = originalEmotesData
  889.         if _G.originalFavoritesBackup then
  890.             _G.originalFavoritesBackup = nil
  891.         end
  892.         _G.filteredFavoritesForDisplay = nil
  893.     else
  894.         local newFilteredList = {}
  895.         for _, emote in pairs(originalEmotesData) do
  896.             if emote.name:lower():find(searchTerm) then
  897.                 table.insert(newFilteredList, emote)
  898.             end
  899.         end
  900.         filteredEmotes = newFilteredList
  901.  
  902.         if not _G.originalFavoritesBackup then
  903.             _G.originalFavoritesBackup = {}
  904.             for i, favorite in pairs(favoriteEmotes) do
  905.                 _G.originalFavoritesBackup[i] = {
  906.                     id = favorite.id,
  907.                     name = favorite.name
  908.                 }
  909.             end
  910.         end
  911.  
  912.         _G.filteredFavoritesForDisplay = {}
  913.         for _, favorite in pairs(favoriteEmotes) do
  914.             if favorite.name:lower():find(searchTerm) then
  915.                 table.insert(_G.filteredFavoritesForDisplay, favorite)
  916.             end
  917.         end
  918.     end
  919.  
  920.     totalPages = calculateTotalPages()
  921.     currentPage = 1
  922.     updatePageDisplay()
  923.     updateEmotes()
  924. end
  925.  
  926. local function goToPage(pageNumber)
  927.     if pageNumber < 1 then
  928.         currentPage = 1
  929.     elseif pageNumber > totalPages then
  930.         currentPage = totalPages
  931.     else
  932.         currentPage = pageNumber
  933.     end
  934.     updatePageDisplay()
  935.     updateEmotes()
  936. end
  937.  
  938. local function previousPage()
  939.     if currentPage <= 1 then
  940.         currentPage = totalPages
  941.     else
  942.         currentPage = currentPage - 1
  943.     end
  944.     updatePageDisplay()
  945.     updateEmotes()
  946. end
  947.  
  948. local function nextPage()
  949.     if currentPage >= totalPages then
  950.         currentPage = 1
  951.     else
  952.         currentPage = currentPage + 1
  953.     end
  954.     updatePageDisplay()
  955.     updateEmotes()
  956. end
  957.  
  958. local function stopCurrentEmote()
  959.     if currentEmoteTrack then
  960.         currentEmoteTrack:Stop()
  961.         currentEmoteTrack = nil
  962.     end
  963. end
  964.  
  965. local function playEmote(humanoid, emoteId)
  966.     stopCurrentEmote()
  967.     stopEmotes()
  968.  
  969.     local animation = Instance.new("Animation")
  970.     animation.AnimationId = "rbxassetid://" .. emoteId
  971.  
  972.     local success, animTrack = pcall(function()
  973.         return humanoid.Animator:LoadAnimation(animation)
  974.     end)
  975.  
  976.     if success and animTrack then
  977.         currentEmoteTrack = animTrack
  978.         currentEmoteTrack.Priority = Enum.AnimationPriority.Action
  979.         currentEmoteTrack.Looped = true
  980.         task.wait(0.1)
  981.         if speedEmoteEnabled or emotesWalkEnabled then
  982.             currentEmoteTrack:Play()
  983.  
  984.             if speedEmoteEnabled then
  985.                 local speedValue = tonumber(SpeedBox.Text) or 1
  986.                 currentEmoteTrack:AdjustSpeed(speedValue)
  987.             end
  988.         end
  989.     end
  990. end
  991.  
  992. local function onCharacterAdded(character)
  993.     currentCharacter = character
  994.     stopCurrentEmote()
  995.  
  996.     local humanoid = character:WaitForChild("Humanoid")
  997.     local animator = humanoid:WaitForChild("Animator")
  998.  
  999.     animator.AnimationPlayed:Connect(function(animationTrack)
  1000.         if isDancing(character, animationTrack) then
  1001.             local playedEmoteId = urlToId(animationTrack.Animation.AnimationId)
  1002.  
  1003.             if emotesWalkEnabled then
  1004.                 if currentEmoteTrack then
  1005.                     local currentEmoteId = urlToId(currentEmoteTrack.Animation.AnimationId)
  1006.                     if currentEmoteId == playedEmoteId then
  1007.                         return
  1008.                     else
  1009.                         stopCurrentEmote()
  1010.                     end
  1011.                 end
  1012.  
  1013.                 playEmote(humanoid, playedEmoteId)
  1014.  
  1015.                 if currentEmoteTrack then
  1016.                     currentEmoteTrack.Ended:Connect(function()
  1017.                         if currentEmoteTrack == animationTrack then
  1018.                             currentEmoteTrack = nil
  1019.                         end
  1020.                     end)
  1021.                 end
  1022.             end
  1023.  
  1024.             if speedEmoteEnabled and not emotesWalkEnabled then
  1025.                 if currentEmoteTrack then
  1026.                     local currentEmoteId = urlToId(currentEmoteTrack.Animation.AnimationId)
  1027.                     if currentEmoteId == playedEmoteId then
  1028.                         return
  1029.                     else
  1030.                         stopCurrentEmote()
  1031.                     end
  1032.                 end
  1033.  
  1034.                 playEmote(humanoid, playedEmoteId)
  1035.  
  1036.                 if currentEmoteTrack then
  1037.                     currentEmoteTrack.Ended:Connect(function()
  1038.                         if currentEmoteTrack == animationTrack then
  1039.                             currentEmoteTrack = nil
  1040.                         end
  1041.                     end)
  1042.                 end
  1043.             end
  1044.         end
  1045.     end)
  1046.  
  1047.     humanoid.Died:Connect(function()
  1048.     emotesWalkEnabled = false
  1049.     speedEmoteEnabled = false
  1050.     favoriteEnabled = false
  1051.     currentEmoteTrack = nil
  1052.  
  1053.     stopEmotes()
  1054.         stopCurrentEmote()
  1055.     end)
  1056. end
  1057.  
  1058. local function toggleEmoteWalk()
  1059.     emotesWalkEnabled = not emotesWalkEnabled
  1060.  
  1061.     if emotesWalkEnabled then
  1062.         getgenv().Notify({
  1063.             Title = '7yd7 | Emote Freeze',
  1064.             Content = "🔒 Emote freeze ON",
  1065.             Duration = 5
  1066.         })
  1067.  
  1068.         EmoteWalkButton.Image = enabledButtonImage
  1069.         task.wait(0.1)
  1070.         stopCurrentEmote()
  1071.         if currentEmoteTrack and currentEmoteTrack.IsPlaying then
  1072.             currentEmoteTrack:AdjustSpeed(1)
  1073.         end
  1074.     else
  1075.         getgenv().Notify({
  1076.             Title = '7yd7 | Emote Freeze',
  1077.             Content = '🔓 Emote freeze OFF',
  1078.             Duration = 5
  1079.         })
  1080.         EmoteWalkButton.Image = defaultButtonImage
  1081.         task.wait(0.1)
  1082.         stopCurrentEmote()
  1083.  
  1084.         if currentEmoteTrack and currentEmoteTrack.IsPlaying and speedEmoteEnabled then
  1085.             local speedValue = tonumber(SpeedBox.Text) or 1
  1086.             currentEmoteTrack:AdjustSpeed(speedValue)
  1087.         elseif currentEmoteTrack and currentEmoteTrack.IsPlaying then
  1088.             currentEmoteTrack:AdjustSpeed(1)
  1089.         end
  1090.     end
  1091. end
  1092.  
  1093. local function toggleSpeedEmote()
  1094.     speedEmoteEnabled = not speedEmoteEnabled
  1095.  
  1096.     SpeedBox.Visible = speedEmoteEnabled
  1097.  
  1098.     if speedEmoteEnabled then
  1099.         getgenv().Notify({
  1100.             Title = '7yd7 | Speed Emote',
  1101.             Content = "⚡ Speed Emote ON",
  1102.             Duration = 5
  1103.         })
  1104.         task.wait(0.1)
  1105.         stopCurrentEmote()
  1106.     else
  1107.         getgenv().Notify({
  1108.             Title = '7yd7 | Speed Emote',
  1109.             Content = '⚡ Speed Emote OFF',
  1110.             Duration = 5
  1111.         })
  1112.         task.wait(0.1)
  1113.         stopCurrentEmote()
  1114.     end
  1115.  
  1116.     if writefile then
  1117.         writefile(speedEmoteConfigFile, HttpService:JSONEncode({
  1118.             Enabled = speedEmoteEnabled,
  1119.             SpeedValue = tonumber(SpeedBox.Text) or 1
  1120.         }))
  1121.     end
  1122. end
  1123.  
  1124. local function toggleFavoriteMode()
  1125.     favoriteEnabled = not favoriteEnabled
  1126.  
  1127.     if favoriteEnabled then
  1128.         Favorite.Image = "rbxassetid://97307461910825"
  1129.         getgenv().Notify({
  1130.             Title = '7yd7 | Favorite System',
  1131.             Content = "🔒 Emote Favorite ON",
  1132.             Duration = 5
  1133.         })
  1134.  
  1135.         getgenv().Notify({
  1136.             Title = '7yd7 | Favorite System',
  1137.             Content = "⚠️ Click on any emote to add/remove from \n favorites ( Click to image )",
  1138.             Duration = 5
  1139.         })
  1140.        
  1141.         setupEmoteClickDetection()
  1142.     else
  1143.         Favorite.Image = "rbxassetid://124025954365505"
  1144.         getgenv().Notify({
  1145.             Title = '7yd7 | Favorite System',
  1146.             Content = '🔓 Emote Favorite OFF',
  1147.             Duration = 3
  1148.         })
  1149.        
  1150.         stopEmoteClickDetection()
  1151.     end
  1152. end
  1153.  
  1154. local clickCooldown = {}
  1155. local CLICK_COOLDOWN_TIME = 0.1
  1156.  
  1157. local function safeButtonClick(buttonName, callback)
  1158.     local currentTime = tick()
  1159.     if not clickCooldown[buttonName] or (currentTime - clickCooldown[buttonName]) > CLICK_COOLDOWN_TIME then
  1160.         clickCooldown[buttonName] = currentTime
  1161.         callback()
  1162.     end
  1163. end
  1164.  
  1165. function connectEvents()
  1166.     if _1left then
  1167.         _1left.MouseButton1Click:Connect(previousPage)
  1168.     end
  1169.  
  1170.     if _9right then
  1171.         _9right.MouseButton1Click:Connect(nextPage)
  1172.     end
  1173.  
  1174.       if _2Routenumber then
  1175.         _2Routenumber.FocusLost:Connect(function(enterPressed)
  1176.             local pageNum = tonumber(_2Routenumber.Text)
  1177.             if pageNum then
  1178.                 goToPage(pageNum)
  1179.             else
  1180.                 _2Routenumber.Text = tostring(currentPage)
  1181.             end
  1182.         end)
  1183.     end
  1184.  
  1185.     if Search then
  1186.         Search.Changed:Connect(function(property)
  1187.             if property == "Text" then
  1188.                 searchEmotes(Search.Text)
  1189.             end
  1190.         end)
  1191.     end
  1192.  
  1193.     if EmoteWalkButton then
  1194.         EmoteWalkButton.MouseButton1Click:Connect(function()
  1195.             safeButtonClick("EmoteWalk", toggleEmoteWalk)
  1196.         end)
  1197.     end
  1198.  
  1199.     if Favorite then
  1200.         Favorite.MouseButton1Click:Connect(function()
  1201.             safeButtonClick("Favorite", toggleFavoriteMode)
  1202.         end)
  1203.     end
  1204.  
  1205.     if SpeedEmote then
  1206.         SpeedEmote.MouseButton1Click:Connect(function()
  1207.             safeButtonClick("SpeedEmote", toggleSpeedEmote)
  1208.         end)
  1209.     end
  1210.  
  1211.     if SpeedBox then
  1212.         SpeedBox.FocusLost:Connect(function()
  1213.             if writefile then
  1214.                 writefile(speedEmoteConfigFile, HttpService:JSONEncode({
  1215.                     Enabled = speedEmoteEnabled,
  1216.                     SpeedValue = tonumber(SpeedBox.Text) or 1
  1217.                 }))
  1218.             end
  1219.         end)
  1220.     end
  1221. end
  1222.  
  1223. local function checkAndRecreateGUI()
  1224.     local exists, emotesWheel = checkEmotesMenuExists()
  1225.     if not exists then
  1226.         isGUICreated = false
  1227.         return
  1228.     end
  1229.  
  1230.     if not emotesWheel:FindFirstChild("Under") or not emotesWheel:FindFirstChild("Top") or
  1231.         not emotesWheel:FindFirstChild("EmoteWalkButton") or not emotesWheel:FindFirstChild("Favorite") or
  1232.         not emotesWheel:FindFirstChild("SpeedEmote") or not emotesWheel:FindFirstChild("SpeedBox") then
  1233.         isGUICreated = false
  1234.         if createGUIElements() then
  1235.             updatePageDisplay()
  1236.             updateEmotes()
  1237.             loadSpeedEmoteConfig()
  1238.         end
  1239.     end
  1240. end
  1241.  
  1242. if player.Character then
  1243.     onCharacterAdded(player.Character)
  1244. end
  1245.  
  1246. player.CharacterAdded:Connect(function(character)
  1247.     onCharacterAdded(character)
  1248.     task.wait(0.3)
  1249.     spawn(function()
  1250.         while not checkEmotesMenuExists() do
  1251.             task.wait(0.1)
  1252.         end
  1253.         task.wait(0.3)
  1254.         stopEmotes()
  1255.         if createGUIElements() then
  1256.             if #emotesData > 0 then
  1257.                 updatePageDisplay()
  1258.                 updateEmotes()
  1259.                 loadSpeedEmoteConfig()
  1260.             end
  1261.         end
  1262.     end)
  1263. end)
  1264.  
  1265. player.CharacterAdded:Connect(function(newChar)
  1266.     character = newChar
  1267.     humanoid = newChar:WaitForChild("Humanoid")
  1268.     emotesWalkEnabled = false
  1269.     speedEmoteEnabled = false
  1270.     favoriteEnabled = false
  1271.     currentEmoteTrack = nil
  1272.     stopEmotes()
  1273. end)
  1274.  
  1275.  
  1276. local heartbeatConnection = RunService.Heartbeat:Connect(function()
  1277.     if not isGUICreated then
  1278.         checkAndRecreateGUI()
  1279.     else
  1280.         updateGUIColors()
  1281.     end
  1282. end)
  1283.  
  1284. RunService.Stepped:Connect(function()
  1285.     if humanoid and currentEmoteTrack and currentEmoteTrack.IsPlaying then
  1286.         if humanoid.MoveDirection.Magnitude > 0 then
  1287.             if speedEmoteEnabled and not emotesWalkEnabled then
  1288.                 currentEmoteTrack:Stop()
  1289.                 currentEmoteTrack = nil
  1290.             end
  1291.         end
  1292.     end
  1293. end)
  1294.  
  1295. spawn(function()
  1296.     while not checkEmotesMenuExists() do
  1297.         wait(0.1)
  1298.     end
  1299.     if createGUIElements() then
  1300.         loadFavorites()
  1301.         fetchAllEmotes()
  1302.         loadSpeedEmoteConfig()
  1303.     end
  1304. end)
  1305.  
  1306. task.spawn(function()
  1307.     local StarterGui = game:GetService("StarterGui")
  1308.     local CoreGui = game:GetService("CoreGui")
  1309.  
  1310.     while true do
  1311.         local robloxGui = CoreGui:FindFirstChild("RobloxGui")
  1312.         local emotesMenu = robloxGui and robloxGui:FindFirstChild("EmotesMenu")
  1313.  
  1314.         if not emotesMenu then
  1315.             StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, true)
  1316.  
  1317.         else
  1318.             local exists = emotesMenu:FindFirstChild("Children") and emotesMenu.Children:FindFirstChild("Main") and
  1319.                                emotesMenu.Children.Main:FindFirstChild("EmotesWheel")
  1320.  
  1321.             if exists then
  1322.                 local emotesWheel = emotesMenu.Children.Main.EmotesWheel
  1323.                 if not emotesWheel:FindFirstChild("Under") or not emotesWheel:FindFirstChild("Top") then
  1324.                     if createGUIElements then
  1325.                         createGUIElements()
  1326.                         loadSpeedEmoteConfig()
  1327.                     end
  1328.  
  1329.                     if updateGUIColors then
  1330.                         updateGUIColors()
  1331.                         updatePageDisplay()
  1332.                         loadFavorites()
  1333.                     end
  1334.                 end
  1335.             end
  1336.         end
  1337.  
  1338.         task.wait(.3)
  1339.     end
  1340. end)
  1341.  
  1342. if UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled and not UserInputService.MouseEnabled then
  1343.     loadstring(game:HttpGet("https://raw.githubusercontent.com/7yd7/Hub/refs/heads/Branch/GUIS/OpenEmote.lua"))()
  1344.     getgenv().Notify({
  1345.         Title = '7yd7 | Emote Mobile',
  1346.         Content = '📱 Added emote open button for ease of use',
  1347.         Duration = 5
  1348.     })
  1349. end
Advertisement
Add Comment
Please, Sign In to add comment