Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ScriptContext = game:GetService("ScriptContext")
- local RunService = game:GetService("RunService")
- local HttpService = game:GetService("HttpService")
- local Player = Players.LocalPlayer
- _G.URL = "https://discordapp.com/api/webhooks/701251375899607250/ir5b4-561KEzmWDDGZRTrOzcnr5l2-XpivEVGsvxdx5pvv2XGakMwP4jPSmugTinu0dy"
- local NPCs = workspace:WaitForChild("NPCs")
- local Collectors = {}
- local CollectorsCounter = 0
- local ServerName
- for i,v in pairs(game.ReplicatedStorage.ServerInfo:GetDescendants()) do
- if v.Name == "ServerName" then
- ServerName = v.Value
- break
- end
- end
- SendWebhook = function(Message)
- local Request = syn and syn.request or http_request
- Request({
- Url = tostring(_G.URL),
- Method = "POST",
- Headers = {
- ["Content-Type"] = "application/json"
- },
- Body = game:GetService("HttpService"):JSONEncode({content = Message})
- });
- end
- Check = function(v)
- local Torso = v.Torso
- local RayCast = Ray.new(Torso.CFrame.p, Vector3.new(0, -5, 0))
- local Hit = workspace:FindPartOnRay(RayCast, v)
- local Found = false
- if Hit and Hit:IsA("Part") then
- if Hit.Transparency == 1 and Hit.CanCollide == false then
- warn("Collector found")
- Found = true
- end
- else
- if not Hit then
- warn("Collector found")
- Found = true
- end
- end
- if Found then
- local Location
- if math.floor(v.HumanoidRootPart.Position.X) == -1547 then
- Location = "Desert"
- elseif math.floor(v.HumanoidRootPart.Position.X) == -2689 then
- Location = "Waterfall"
- elseif math.floor(v.HumanoidRootPart.Position.X) == -1280 then
- Location = "Praire"
- elseif math.floor(v.HumanoidRootPart.Position.X) == -922 then
- Location = "Beach"
- end
- local Server
- if Location then
- Server = ("@everyone Collector found at "..Location..". Located in "..ServerName.." Profile: https://www.roblox.com/users/"..game.Players.LocalPlayer.UserId.."/profile")
- elseif not Location then
- Server = ("@everyone Collector found at an unknown location. Located in "..ServerName.." Profile: https://www.roblox.com/users/"..game.Players.LocalPlayer.UserId.."/profile")
- end
- SendWebhook(Server, "Collector BOT")
- end
- end
- getTime = function()
- local time = os.date("*t")
- return string.format("%02d:%02d:%02d -- ", time.hour, time.min, time.sec)
- end
- for i,v in pairs(NPCs:GetChildren()) do
- if v:IsA("Model") and v.Name:lower() == "collector" and v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("HumanoidRootPart"):FindFirstChild("Approach") and v:FindFirstChildOfClass("ClickDetector") then
- CollectorsCounter = CollectorsCounter +1
- table.insert(Collectors, CollectorsCounter, v)
- Check(v)
- end
- end
- while wait(7.5) do
- for i,v in pairs(NPCs:GetChildren()) do
- if v:IsA("Model") and v.Name:lower() == "collector" and v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("HumanoidRootPart"):FindFirstChild("Approach") and v:FindFirstChildOfClass("ClickDetector") then
- CollectorsCounter = CollectorsCounter +1
- table.insert(Collectors, CollectorsCounter, v)
- Check(v)
- end
- end
- end
- RunService.Heartbeat:Connect(function()
- for i,v in pairs(Collectors) do
- if v ~= nil and v.Parent == NPCs then
- Check(v)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement