Advertisement
fusionfriends

collector logger

Apr 18th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ScriptContext = game:GetService("ScriptContext")
  3. local RunService = game:GetService("RunService")
  4. local HttpService = game:GetService("HttpService")
  5. local Player = Players.LocalPlayer
  6. _G.URL = "https://discordapp.com/api/webhooks/701251375899607250/ir5b4-561KEzmWDDGZRTrOzcnr5l2-XpivEVGsvxdx5pvv2XGakMwP4jPSmugTinu0dy"
  7.  
  8. local NPCs = workspace:WaitForChild("NPCs")
  9. local Collectors = {}
  10. local CollectorsCounter = 0
  11. local ServerName
  12. for i,v in pairs(game.ReplicatedStorage.ServerInfo:GetDescendants()) do
  13. if v.Name == "ServerName" then
  14. ServerName = v.Value
  15. break
  16. end
  17. end
  18. SendWebhook = function(Message)
  19. local Request = syn and syn.request or http_request
  20. Request({
  21. Url = tostring(_G.URL),
  22. Method = "POST",
  23. Headers = {
  24. ["Content-Type"] = "application/json"
  25. },
  26. Body = game:GetService("HttpService"):JSONEncode({content = Message})
  27. });
  28. end
  29.  
  30. Check = function(v)
  31. local Torso = v.Torso
  32.  
  33. local RayCast = Ray.new(Torso.CFrame.p, Vector3.new(0, -5, 0))
  34. local Hit = workspace:FindPartOnRay(RayCast, v)
  35. local Found = false
  36.  
  37. if Hit and Hit:IsA("Part") then
  38. if Hit.Transparency == 1 and Hit.CanCollide == false then
  39. warn("Collector found")
  40. Found = true
  41. end
  42. else
  43. if not Hit then
  44. warn("Collector found")
  45. Found = true
  46. end
  47. end
  48. if Found then
  49. local Location
  50. if math.floor(v.HumanoidRootPart.Position.X) == -1547 then
  51. Location = "Desert"
  52. elseif math.floor(v.HumanoidRootPart.Position.X) == -2689 then
  53. Location = "Waterfall"
  54. elseif math.floor(v.HumanoidRootPart.Position.X) == -1280 then
  55. Location = "Praire"
  56. elseif math.floor(v.HumanoidRootPart.Position.X) == -922 then
  57. Location = "Beach"
  58. end
  59. local Server
  60. if Location then
  61. Server = ("@everyone Collector found at "..Location..". Located in "..ServerName.." Profile: https://www.roblox.com/users/"..game.Players.LocalPlayer.UserId.."/profile")
  62. elseif not Location then
  63. Server = ("@everyone Collector found at an unknown location. Located in "..ServerName.." Profile: https://www.roblox.com/users/"..game.Players.LocalPlayer.UserId.."/profile")
  64. end
  65. SendWebhook(Server, "Collector BOT")
  66. end
  67. end
  68.  
  69. getTime = function()
  70. local time = os.date("*t")
  71. return string.format("%02d:%02d:%02d -- ", time.hour, time.min, time.sec)
  72. end
  73. for i,v in pairs(NPCs:GetChildren()) do
  74. if v:IsA("Model") and v.Name:lower() == "collector" and v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("HumanoidRootPart"):FindFirstChild("Approach") and v:FindFirstChildOfClass("ClickDetector") then
  75. CollectorsCounter = CollectorsCounter +1
  76. table.insert(Collectors, CollectorsCounter, v)
  77. Check(v)
  78. end
  79. end
  80.  
  81. while wait(7.5) do
  82. for i,v in pairs(NPCs:GetChildren()) do
  83. if v:IsA("Model") and v.Name:lower() == "collector" and v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("HumanoidRootPart"):FindFirstChild("Approach") and v:FindFirstChildOfClass("ClickDetector") then
  84. CollectorsCounter = CollectorsCounter +1
  85. table.insert(Collectors, CollectorsCounter, v)
  86. Check(v)
  87. end
  88. end
  89. end
  90.  
  91. RunService.Heartbeat:Connect(function()
  92. for i,v in pairs(Collectors) do
  93. if v ~= nil and v.Parent == NPCs then
  94. Check(v)
  95. end
  96. end
  97. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement