Advertisement
za0623247821

เช็ค STOCK

Feb 13th, 2024 (edited)
976
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.76 KB | None | 0 0
  1. local IconTable = {}
  2. local Webhook = "https://discordapp.com/api/webhooks/1206623566708219904/AoEZ27VBtsrSMSlgJYFUa-7OwTk7pvidICdfr-EP91J3nTWvBYNKP4Fc3yVUZRRCAF6Z"
  3. local Data = {}
  4. local HttpService = game:GetService("HttpService")
  5. local Text = ""
  6. local Rarity = {}
  7. for i,v in pairs(game:GetService("ReplicatedStorage").FrameworkDependencies:GetChildren()) do
  8.     if v:FindFirstChild("RarityGradients") then
  9.         for i1,v1 in pairs(v["RarityGradients"]:GetChildren()) do
  10.             table.insert(Rarity,v1.Name)
  11.         end
  12.     end
  13. end
  14. local IconTable = {}
  15. for i,v in pairs(game["ReplicatedStorage"]["FrameworkDependencies"]:GetChildren()) do
  16.     if v:FindFirstChild("TroopDatas") then
  17.         for i1,v1 in pairs(v["TroopDatas"]:GetChildren()) do
  18.             for v2,v2 in pairs(v1:GetChildren()) do
  19.                 local table1 = require(v2)
  20.                 if type(table1) == "table" and table1.Icon ~= nil then
  21.                     IconTable[tostring(table1.Icon)] = {v2.Name,table1.Rarity}
  22.                 else
  23.                     local table2 = getconstants(table1)
  24.                     local Asset
  25.                     local Rarity1
  26.                     for i,v in pairs(table2) do
  27.                      
  28.                         if tostring(v):match("rbx") then
  29.                             Asset = v
  30.                         end
  31.                         if table.find(Rarity,v) then
  32.                             Rarity1 = v
  33.                         end
  34.                     end
  35.  
  36.                     IconTable[Asset] = {v2.Name,Rarity1}
  37.                 end
  38.             end
  39.         end
  40.     end
  41. end
  42.  
  43. for i,v in pairs(getgc()) do
  44.     if type(v) == "function" and getfenv(v).script == game:GetService("Players").LocalPlayer.PlayerGui.Lobby.UnitFrame.UnitInvHandler and getinfo(v).name == "UpdateInventory" then
  45.         v()
  46.     end
  47. end
  48.  
  49. local rarityData = {}
  50. local color = {
  51.     Mythic = "🔴";
  52.     Godly = "🔵";
  53.     Exclusive = "🟣"
  54. }
  55.  
  56. for i,v in pairs(game:GetService("Players").LocalPlayer.PlayerGui.Lobby.UnitFrame.UnitList:GetChildren()) do
  57.     if v:IsA("Frame") and v:FindFirstChild("TroopsFrame") then
  58.         local index = IconTable[tostring(v["TroopsFrame"].TroopIcon.Image)]
  59.          if index then
  60.             print(index[2])
  61.          end
  62.         if index and index[1] and (index[2] == "Mythic" or index[2] == "Exclusive" or index[2] == "Godly") then
  63.             rarityData[index[1]] = index[2]
  64.             Data[index[1]] = not Data[index[1]] and 1 or Data[index[1]] + 1
  65.         end
  66.     end
  67. end
  68.  
  69. for index,value in Data do
  70.     local rarityText = color[rarityData[index] or ""]
  71.  
  72.     Text = Text .. `{index} {rarityText or ""} จำนวน {value} ตัว \n`
  73. end
  74.  
  75. local json = {
  76.     ["embeds"] = {{
  77.         ['username'] = "",
  78.         ["title"] = "ระบบเช็ค STOCK ของ",
  79.         ["description"] = Text,
  80.         ["type"] = "rich",
  81.         ["color"] = tonumber(0x4287f5),
  82.         ["footer"] = {
  83.             ["text"] = "บริษัท PaPaiShop TH จำกัด";
  84.             ["icon_url"] = "https://cdn.discordapp.com/attachments/1032149598690615318/1207178981342842880/42_20240129201657.PNG?ex=65deb409&is=65cc3f09&hm=1a9f6c01257d18e537ecd955d4884e29926f040c1cf1e8a68aee4cb1125dff70&";
  85.         };
  86.     }}
  87. }
  88.  
  89. local req = http_request
  90. if req then
  91.     req({
  92.         Url = Webhook;
  93.         Method = 'POST';
  94.         Headers = {
  95.             ['Content-Type'] = 'application/json';
  96.         };
  97.         Body = game:GetService('HttpService'):JSONEncode(json);
  98.     })
  99. end
  100.  
  101.  
  102. -- for i,v in pairs(getgc()) do
  103. --     if type(v) == "function" and getfenv(v).script == game:GetService("Players").LocalPlayer.PlayerGui.MainFrames.TroopsSelector.SelectorHandler then
  104. --         local a
  105. --         a = hookfunction(v,function(...)
  106. --             print(...,getinfo(v).name,i)
  107. --             return a(...)
  108. --         end)
  109. --     end
  110. -- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement