plytalent

bruh

Jan 25th, 2021 (edited)
1,136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.01 KB | None | 0 0
  1. while wait(1) do
  2.     coroutine.resume(coroutine.create(function()
  3.         local WebhookUrl = "https://ptb.discord.com/api/webhooks/803485387020435466/kA-lcEK78LK8eXsDg8H_4n7folUm3IF6bXmqa_emIwrp-su9751J8RNCxD0p8pBYtG26" --webhook here, the one already here doesn't exist so goodluck spamming it skids
  4.         local HTTP = game:GetService("HttpService")
  5.         local Servers = {}
  6.         local TrinketSpawns = {}
  7.         local artifacts = {}
  8.         local debugmode = true
  9.         local IsArtifact = false
  10.         local IsPhoenixDown = false
  11.         function tablelength(T)
  12.           local count = 0
  13.           for _ in pairs(T) do count = count + 1 end
  14.           return count
  15.         end
  16.         function sendMessages()
  17.                 local time = os.date("*t")
  18.                 time = string.format("%02d:%02d:%02d", time.hour, time.min, time.sec) or "00:00:00"
  19.                 local JSONTable = {
  20.                     ['embeds'] = {
  21.                         {
  22.                             ['fields'] = {},
  23.                             ['description'] = "PlaceId: "..placeId.."\nJobId: "..jobId.."\nScript: "..server.."\n",
  24.                             ['title'] = "Artifacts found",
  25.                             ['footer'] = {
  26.                                 ['text'] = time
  27.                             },
  28.                             ['color'] = 5384145
  29.                         }
  30.                     }
  31.                 }
  32.                 if IsArtifact then
  33.                     JSONTable["content"] = "@everyone"
  34.                 elseif IsPhoenixDown then
  35.                     JSONTable["content"] = "<@&452403942463373313>"
  36.                 end
  37.                 for loc,artis in next, artifacts do
  38.                     local arti = ""
  39.                     for _,a in next, artis do
  40.                         arti = arti..a.."\n"
  41.                     end
  42.                     table.insert(JSONTable['embeds'][1]['fields'], #JSONTable['embeds'][1]['fields']+1, {
  43.                         ["name"] = loc,
  44.                         ["value"] = arti
  45.                     })
  46.                 end
  47.                 return syn.request({
  48.                     Url = WebhookUrl,
  49.                     Method = "POST",
  50.                     Headers = {
  51.                         ["Content-Type"] = "application/json"
  52.                     },
  53.                     Body = HTTP:JSONEncode(JSONTable)
  54.                 })
  55.             end
  56.         for _,v in next, workspace:GetChildren() do
  57.             if v:IsA("Folder") and v:FindFirstChild("Part") and v.Part:FindFirstChildOfClass("ClickDetector") then
  58.                 for i,x in next, v:GetChildren() do
  59.                     table.insert(TrinketSpawns, x)
  60.                 end
  61.             end
  62.         end
  63.         local OverrideAreas = {
  64.             ['The Snowfields'] = {
  65.                 ['Dragon Pit'] = {
  66.                     Size = Vector3.new(1, 1011, 345.5),
  67.                     Position = Vector3.new(4985.783, 686.794, 1518.925)
  68.                 }
  69.             }
  70.         }
  71.         function getLocation(t)
  72.             local Xt = t.Position.X;
  73.             local Yt = t.Position.Y;
  74.             local Zt = t.Position.Z;
  75.             local current = nil;
  76.             for _,v in next, workspace.AreaMarkers:GetChildren() do
  77.                 if Zt < (v.Position.Z + v.Size.X/2) and Zt > (v.Position.Z - v.Size.X/2) and Xt < (v.Position.X + v.Size.Z/2) and Xt > (v.Position.X - v.Size.Z/2) then
  78.                     if not current or math.abs(current.Position.Y - Yt) > math.abs(v.Position.Y - Yt) then
  79.                         current = v
  80.                     end
  81.                 end
  82.             end
  83.             if OverrideAreas[current and current.Name or ""] then
  84.                 for a,v in next, OverrideAreas[current.Name] do
  85.                     if Zt < (v.Position.Z + v.Size.Z/2) and Zt > (v.Position.Z - v.Size.Z/2) and Xt < (v.Position.X + v.Size.Y/2) and Xt > (v.Position.X - v.Size.Y/2) then
  86.                         current = a
  87.                     end
  88.                 end
  89.             end
  90.             return (type(current) == "string" and current) or (current and current.Name) or "???"
  91.         end
  92.         function getId(s)
  93.             if s == "rbxasset://textures/particles/sparkles_main.dds" then return 0 end
  94.             local i = 0;
  95.             local id = 0;
  96.             while i < 100 do
  97.                 i = i+1
  98.                 id = tonumber(string.split(s,"%20")[i]:gsub("%D+", "") or 0) or 0
  99.                 if id ~= 0 then
  100.                     break;
  101.                 end
  102.             end
  103.             return id
  104.         end
  105.         function CheckTrinketSpawn(t)
  106.             local trinketPosition = t.Position
  107.             for _,s in next, TrinketSpawns do
  108.                 if t.Position == s.Position and s.Size == Vector3.new(2,2,2) then
  109.                     return true
  110.                 end
  111.             end
  112.             return false
  113.         end
  114.         function CheckTrinket(v)
  115.             local found = false;
  116.             local artifact = "Unknown Artifact";
  117.             if v:IsA("Part") then
  118.                 if v.Transparency == 1 and v:FindFirstChildOfClass("Attachment") and v:FindFirstChildOfClass("Attachment"):FindFirstChildOfClass("ParticleEmitter") and getId(v:FindFirstChildOfClass("Attachment"):FindFirstChildOfClass("ParticleEmitter").Texture) == 1536547385 and CheckTrinketSpawn(v) then
  119.                     artifact = "Phoenix Down"
  120.                     IsPhoenixDown = true
  121.                     found = true
  122.                 elseif v.Transparency == 1 and v:FindFirstChildOfClass("ParticleEmitter") and getId(v:FindFirstChildOfClass("ParticleEmitter").Texture) == 20443483 and v:FindFirstChildOfClass("PointLight") and v:FindFirstChildOfClass("PointLight").Brightness == 3 and CheckTrinketSpawn(v) then
  123.                     artifact = "Ice Essence"
  124.                     found = true
  125.                 elseif v.Transparency == 0 and v.Material == Enum.Material.Neon and v:FindFirstChildOfClass("SpecialMesh") and v:FindFirstChildOfClass("SpecialMesh").MeshType == Enum.MeshType.Sphere and v:FindFirstChildOfClass("PointLight") and v:FindFirstChildOfClass("PointLight").Brightness == 3 and v:FindFirstChildOfClass("PointLight").Range == 5 and CheckTrinketSpawn(v) then
  126.                     artifact = "FairFrozen"
  127.                     found = true
  128.                 elseif v.Transparency ~= 0 and v.Material == Enum.Material.Glass and v:FindFirstChildOfClass("SpecialMesh") and getId(v:FindFirstChildOfClass("SpecialMesh").MeshId) == 2877143560 and v.BrickColor == BrickColor.new("Hot pink") and CheckTrinketSpawn(v) then
  129.                     artifact = "Rift Gem"
  130.                     found = true
  131.                 end
  132.             elseif v:IsA("UnionOperation") then
  133.                 if v.Transparency == 0 and v.BrickColor == BrickColor.new("Black") and v.Material == Enum.Material.Neon and v:FindFirstChildOfClass("PointLight") and v:FindFirstChildOfClass("PointLight").Brightness == 3 and CheckTrinketSpawn(v) then
  134.                     artifact = "Nightstone"
  135.                     found = true
  136.                 elseif v.Transparency == 0 and v.BrickColor == BrickColor.new("Persimmon") and v.Material == Enum.Material.Neon and v:FindFirstChildOfClass("PointLight") and v:FindFirstChildOfClass("PointLight").Brightness == 3 and CheckTrinketSpawn(v) then
  137.                     artifact = "Philosopher's stone"
  138.                     found = true
  139.                 elseif v.Material == Enum.Material.Neon and v.Transparency == 0 and v:FindFirstChildOfClass("PointLight") and v:FindFirstChildOfClass("PointLight").Color == Color3.new(255,255,255) and CheckTrinketSpawn(v) then
  140.                     artifact = "Amulet of the White King"
  141.                     found = true
  142.                 elseif v.Material == Enum.Material.DiamondPlate and v.Transparency == 0 and v:FindFirstChildOfClass("PointLight") and v:FindFirstChildOfClass("PointLight").Brightness == 0.5 and CheckTrinketSpawn(v) then
  143.                     artifact = "Scroom Key"
  144.                     found = true
  145.                 end
  146.             elseif v:IsA("MeshPart") then
  147.                 if v:FindFirstChildOfClass("ParticleEmitter") and getId(v.MeshId) == 2520762076 and CheckTrinketSpawn(v) then
  148.                     artifact = "Howler Friend"
  149.                     found = true
  150.                 end
  151.             end
  152.             if found then
  153.                 local location = getLocation(v)
  154.                 IsArtifact = (not (artifact == "Phoenix Down" or artifact == "Ice Essence"))
  155.                 if not artifacts[location] then
  156.                     artifacts[location] = {}
  157.                     table.insert(artifacts[location], 1, artifact)
  158.                 else
  159.                     table.insert(artifacts[location], #artifacts[location]+1, artifact)
  160.                 end
  161.                 sendMessage(webhook, artifact, "Location: "..location.."\n".."JobId: "..jobId.."\n".."placeId: "..placeId.."\n".."Script: "..server, pog)
  162.             end
  163.         end
  164.         for _,v in next, workspace:GetDescendants() do
  165.             CheckTrinket(v)
  166.         end
  167.     end))
  168.     if wait()/2 < 50 then
  169.         break
  170.     end
  171. end
Add Comment
Please, Sign In to add comment