Advertisement
Scriptorz5

ms2 webhook noti

Jun 8th, 2022
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. if game.PlaceId == 9551640993 then
  2. if not game:IsLoaded() then game.Loaded:Wait() end
  3.  
  4. local a = require(game:GetService("ReplicatedStorage").SharedModules.Data.Eggs)
  5. local b = require(game:GetService("ReplicatedStorage").ClientModules.LocalData).GetData()
  6. local List = {"K","M","B","T"}
  7.  
  8. if _G.Executed == nil then
  9. _G.Executed = true
  10.  
  11. function c3toDecimal(c3)
  12. return tonumber(c3:ToHex(), 16)
  13. end
  14. function NumberSuffix(Num)
  15. local ListCount = 0
  16. while Num / 1000 >= 1 do
  17. ListCount = ListCount + 1
  18. Num = Num / 1000
  19. end
  20. if ListCount == 0 then return Num end
  21. return math.floor(Num*10)/10 ..List[ListCount]
  22. end
  23.  
  24. game:GetService("Players").LocalPlayer.PlayerGui.Chat.Frame.ChatChannelParentFrame["Frame_MessageLogDisplay"].Scroller.ChildAdded:Connect(function(child)
  25. local okay = string.split(child.TextLabel.Text, " ")
  26. local kkay = string.split(child.TextLabel.Text, "[Server]: ")
  27. local Message = nil
  28. if okay[1] == "[Server]:" and okay[2] == game.Players.LocalPlayer.Name then
  29. for i,v in pairs(_G.PetsToPing) do
  30. if string.find(child.TextLabel.Text, v) and _G.Discord_UserID ~= "" then
  31. Message = " :loudspeaker: <@" .. tostring(_G.Discord_UserID) .. ">"
  32. end
  33. end
  34. msg = {
  35. ["content"] = Message,
  36. ["embeds"] = {{
  37. ["title"] = "Eggs Hatched: "..NumberSuffix(game:GetService("Players").LocalPlayer.leaderstats.Eggs.Value).." | ".."Coins: "..NumberSuffix(math.floor(b.Coins)).." | "..NumberSuffix(math.floor(b.Coins / a[game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.EggDisplay.Title.Text].Cost[2])).." Eggs remaining",
  38. ["description"] = kkay[2],
  39. ["color"] = c3toDecimal(child.TextLabel.TextColor3),
  40. }}
  41. }
  42. local response = syn.request(
  43. {
  44. Url = _G.Webhook,
  45. Method = "POST",
  46. Headers = {
  47. ["Content-Type"] = "application/json"
  48. },
  49. Body = game:GetService("HttpService"):JSONEncode(msg)
  50. }
  51. )
  52. end
  53. end)
  54. end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement