Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.78 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Camera = workspace.CurrentCamera
  3. local Devils = workspace:WaitForChild("Devils")
  4. local Sound = Instance.new("Sound")
  5. Sound.Parent = game.SoundService
  6. Sound.SoundId = "rbxassetid://216917652"
  7. Sound.Volume = 1
  8.  
  9. local webhook_url = "PUT YOUR LINK HERE"
  10.  
  11. local function discordNotify(location)
  12.     local currentServer = Player.PlayerGui.StartMenu.PublicServers.ScrollingFrame["000"].ServerName.Text
  13.  
  14.     local response = syn.request(
  15.        {
  16.            Url = webhook_url,
  17.            Method = 'POST',
  18.            Headers = {
  19.                ['Content-Type'] = 'application/json'
  20.            },
  21.            Body = game:GetService('HttpService'):JSONEncode({content = '@here Collector has spawned in server: '.. currentServer.. " at ".. location})
  22.        }
  23.     );
  24. end
  25.  
  26. local CameraSet = false
  27. local DiscordSet = false
  28.  
  29. local colorDict = {
  30.     ["Plains"] = BrickColor.new("Dark stone grey");
  31.     ["Jungle"] = BrickColor.new("Bronze");
  32.     ["Desert"] = BrickColor.new("Fawn brown");
  33.     ["Beach"] = BrickColor.new("Smoky grey");
  34. };
  35.  
  36. pcall(function()
  37.     Camera.CameraSubject = workspace["SmithingStation"]
  38.     while wait() do
  39.         for _, Room in pairs(Devils:GetChildren()) do
  40.             if Room.Transparency == 1 or Room.CanCollide == false then
  41.                 if not CameraSet then
  42.                     Camera.CameraSubject = Room.Exit
  43.                     CameraSet = true
  44.                 end
  45.                 if not Sound.IsPlaying then
  46.                     Sound:Play()
  47.                 end
  48.                 if not DiscordSet then
  49.                     local color = Room.BrickColor
  50.                     local room
  51.                     for loc, c in pairs(colorDict) do
  52.                         if color == c then
  53.                             room = loc
  54.                         end
  55.                     end
  56.                     discordNotify(room)
  57.                     DiscordSet = true
  58.                 end
  59.             end
  60.         end
  61.         if #Devils:GetChildren() ~= 4 then
  62.             print("Condition 2 Met")
  63.             if not Sound.IsPlaying then
  64.                 Sound:Play()
  65.             end
  66.         end
  67.     end
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement