Advertisement
Gerard_games

Pet sim notify hatch

Sep 27th, 2021 (edited)
17,290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 KB | None | 0 0
  1. if game.PlaceId == 6284583030 or game.PlaceId == 7722306047 then
  2. repeat wait() until game:GetService("Players")
  3. repeat wait() until game:GetService("Players").LocalPlayer
  4. repeat wait() until game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Loading"):WaitForChild("Black").BackgroundTransparency == 1
  5. repeat wait() until game:GetService("Players").LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
  6.  
  7. local Library = require(game:GetService("ReplicatedStorage").Framework.Library)
  8. local IDToName = {}
  9. local PettoRarity = {}
  10. for i,v in pairs(Library.Directory.Pets) do
  11. IDToName[i] = v.name
  12. PettoRarity[i] = v.rarity
  13. end
  14.  
  15. function GetThumbnail(id, type)
  16. local nailname = (type == 'Normal' or type == 'Rainbow' and 'thumbnail') or (type == 'Gold' and 'goldenThumbnail') or (type == 'Dark Matter' and 'darkMatterThumbnail')
  17. local eeee = Library.Directory.Pets[tostring(id)][nailname] or Library.Directory.Pets[tostring(id)]["thumbnail"]
  18. local AssetIdImage = string.format("https://www.roblox.com/asset-thumbnail/image?assetId=%d&width=420&height=420&format=png", string.gsub(eeee, "rbxassetid://", ""))
  19. return AssetIdImage
  20. end
  21.  
  22. function Send(Name, Nickname, Strength, Rarity, Thumbnail, Formation, Color, NewPowers, nth)
  23. local Webhook = _G.Webhook
  24. local msg = {
  25. ["username"] = "Pet Webhook Thing",
  26. ["embeds"] = {
  27. {
  28. ["color"] = tonumber(tostring("0x" .. Color)), --decimal
  29. ["title"] = "*" .. Rarity .. "* " .. Name,
  30. ["thumbnail"] = {
  31. ["url"] = Thumbnail
  32. },
  33. ["fields"] = {
  34. {
  35. ["name"] = "Nickname",
  36. ["value"] = Nickname,
  37. ["inline"] = true
  38. },
  39. {
  40. ["name"] = "Formation",
  41. ["value"] = Formation,
  42. ["inline"] = true
  43. },
  44. {
  45. ["name"] = "Strength",
  46. ["value"] = Strength,
  47. ["inline"] = true
  48. },
  49. },
  50. ["author"] = {},
  51. ["footer"] = {
  52. ["text"] = "n= "..nth,
  53. },
  54. ['timestamp'] = os.date("%Y-%m-%dT%X.000Z"),
  55. }
  56. }
  57. }
  58. for qq,bb in pairs(NewPowers) do
  59. local thingy = {
  60. ["name"] = "Enchantment "..tostring(qq),
  61. ["value"] = bb,
  62. ["inline"] = true
  63. }
  64. table.insert(msg["embeds"][1]["fields"], thingy)
  65. end
  66. request = http_request or request or HttpPost or syn.request
  67. request({Url = Webhook, Method = "POST", Headers = {["Content-Type"] = "application/json"}, Body = game.HttpService:JSONEncode(msg)})
  68. end
  69.  
  70. function SendWebhook(uid)
  71. for i,v in pairs(Library.Save.Get().Pets) do
  72. if v.uid == uid and _G.TrackList[PettoRarity[v.id]] then
  73. local ThingyThingyTempTypeThing = (v.g and 'Gold') or (v.r and 'Rainbow') or (v.dm and 'Dark Matter') or 'Normal'
  74. local Formation = (v.g and ':crown: Gold') or (v.r and ':rainbow: Rainbow') or (v.dm and ':milky_way: Dark Matter') or ':roll_of_paper: Normal'
  75. local Thumbnail = GetThumbnail(v.id, ThingyThingyTempTypeThing)
  76. local Name = IDToName[v.id]
  77. local Nickname = v.nk
  78. local nth = v.idt
  79. local Strength = v.s
  80. local Powers = v.powers or {}
  81. local Rarity = PettoRarity[v.id]
  82. local Color = (Rarity == 'Exclusive' and "e676ff") or (Rarity == 'Mythical' and "ff8c00") or (Rarity == 'Legendary' and "ff45f6") or (Rarity == 'Epic' and "ffea47") or (Rarity == 'Rare' and "42ff5e") or (Rarity == 'Basic' and "b0b0b0")
  83. local NewPowers = {}
  84. for a,b in pairs(Powers) do
  85. local eeeeeeee = tostring(b[1] .. " " .. b[2])
  86. table.insert(NewPowers, eeeeeeee)
  87. end
  88. Send(Name, Nickname, Library.Functions.Commas(Strength), Rarity, Thumbnail, Formation, Color, NewPowers, nth)
  89. end
  90. end
  91. end
  92.  
  93. if _G.Connection then _G.Connection:Disconnect() end
  94. _G.Connection = game:GetService("Players").LocalPlayer.PlayerGui.Inventory.Frame.Main.Pets.ChildAdded:Connect(function(child)
  95. SendWebhook(child.Name)
  96. end)
  97. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement