Noctural

Starving Artists | Source

May 3rd, 2023 (edited)
5,451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.00 KB | None | 0 0
  1. -- Settings
  2. local Settings = {} and Settings or {
  3.     Image = "",
  4.     FastMode = false,
  5.     Mode = "Randomize"
  6. }
  7.  
  8. -- Services
  9. local Players = game:GetService("Players")
  10. local HttpService = game:GetService("HttpService")
  11. local StarterGui = game:GetService("StarterGui")
  12.  
  13. -- Varriables
  14. local LocalPlayer = Players.LocalPlayer
  15. local MainGui = LocalPlayer.PlayerGui:WaitForChild("MainGui")
  16.  
  17. function GetGrid()
  18.     local Grid = MainGui:WaitForChild("PaintFrame", 1):WaitForChild("Grid", 1)
  19.  
  20.     if not Grid then
  21.         Grid = MainGui:WaitForChild("PaintFrame", 1):WaitForChild("GridHolder", 1):WaitForChild("Grid", 1)
  22.     end
  23.  
  24.     return Grid
  25. end
  26.  
  27. function SendNotify(title, text)
  28.     StarterGui:SetCore("SendNotification", {
  29.         Title = title,
  30.         Text = text
  31.     })
  32. end
  33.  
  34. local Grid = GetGrid()
  35.  
  36. function GetJson(url)
  37.     if string.len(url) > 5 then
  38.         local Response = game:HttpGet("https://f818fcf9-3b10-4c92-8176-0bef47a8421d.id.repl.co/get?url=" .. url)
  39.  
  40.         return Response == "the file size is too big!" and "fstb" or HttpService:JSONDecode(Response)
  41.     end
  42. end
  43.  
  44. function Import(url)
  45.     local pixels = GetJson(url)
  46.     local usedIndices = {}
  47.  
  48.     if (pixels == "fstb") then
  49.         SendNotify("Occurred Error", "File too large, limit set to prevent VPS crash. Apologies for the inconvenience")
  50.     else
  51.         if not Grid then Grid = GetGrid() end
  52.    
  53.         for i = 1, #pixels do
  54.             local pixelIndex = i
  55.  
  56.             if Settings.Mode == "Randomize" then
  57.                 pixelIndex = math.random(#pixels)
  58.                
  59.                 while usedIndices[pixelIndex] do
  60.                     pixelIndex = math.random(#pixels)
  61.                 end
  62.                
  63.                 usedIndices[pixelIndex] = true
  64.             end
  65.            
  66.             local pixel = pixels[pixelIndex]
  67.             local r, g, b = pixel[1], pixel[2], pixel[3]
  68.            
  69.             Grid[tostring(pixelIndex)].BackgroundColor3 = Color3.fromRGB(r, g, b)
  70.            
  71.             if not Settings.FastDraw then task.wait(.1); end
  72.         end
  73.    end
  74. end
  75.  
  76. -- User Interface
  77. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/bloodball/-back-ups-for-libs/main/wally2", true))()
  78. local Window = Library:CreateWindow("StarvArt | EsohaSL")
  79.  
  80. Window:Button("Draw", function()
  81.     task.spawn(function()
  82.         Import(Settings.Image)
  83.     end)
  84. end)
  85.  
  86. Window:Box("Image URL", {}, function(value)
  87.     task.spawn(function()
  88.         Settings.Image = value
  89.     end)
  90. end)
  91.  
  92. Window:Dropdown("Draw Mode", {list = { "Randomize", "By Step" } }, function(var)
  93.     task.spawn(function()
  94.         Settings.Mode = var
  95.     end)
  96. end)
  97.  
  98. Window:Toggle("Fast Draw", {default = false}, function(state)
  99.     task.spawn(function()
  100.         Settings.FastDraw = state
  101.     end)
  102. end)
  103.  
  104. Window:Button("YouTube: EsohaSL", function()
  105.     task.spawn(function()
  106.         pcall(function()
  107.             setclipboard("https://www.youtube.com/@esohasl")
  108.         end)
  109.     end)
  110. end)
Advertisement
Add Comment
Please, Sign In to add comment