1. local image = 'https://media.discordapp.net/attachments/948249412835098634/955526363899629658/v3rm-6.png' -- image you want to import
  2. local resolutionX = 32 -- usually it's 32 but it might change depending on the frame?
  3. local resolutionY = 32 -- usually it's 32 but it might change depending on the frame?
  4. -- epic coding stuf --
  5. local grid = nil
  6. local s, e = pcall(function()
  7. if game.Players.LocalPlayer.PlayerGui:FindFirstChild'MainGui':FindFirstChild'PaintFrame':FindFirstChild'Grid' then
  8. grid = game.Players.LocalPlayer.PlayerGui.MainGui.PaintFrame.Grid
  9. elseif game.Players.LocalPlayer.PlayerGui:FindFirstChild'PaintFrame':FindFirstChild'GridHolder':FindFirstChild'Grid' then
  10. grid = game.Players.LocalPlayer.PlayerGui.MainGui.PaintFrame.GridHolder.Grid
  11. else
  12. warn('cannot execute script')
  13. return
  14. end
  15. end)
  16. if e then
  17. local s1, e1 = pcall(function()
  18. grid = game.Players.LocalPlayer.PlayerGui.MainGui.PaintFrame.GridHolder.Grid
  19. end)
  20. if e1 then
  21. warn('cannot execute script')
  22. return
  23. end
  24. end
  25. local h = game:GetService("HttpService")
  26. function getjson(url)
  27. local begin = game:HttpGet("https://f818fcf9-3b10-4c92-8176-0bef47a8421d.id.repl.co/get?url="..url)
  28. if (begin == 'the file size is too big!') then
  29. return 'fstb'
  30. else
  31. local json = h:JSONDecode(begin)
  32. return json
  33. end
  34. end
  35. function import(url)
  36. local pixels = getjson(url)
  37. local cells = {}
  38. local index = 1
  39. if (pixels == 'fstb') then
  40. game.StarterGui:SetCore(
  41. "SendNotification",
  42. {
  43. Title = "error",
  44. Text = "the file size exceeds three megabytes, "
  45. .."to prevent people from crashing my vps i have set"
  46. .." the cap to amount. sorry for the inconvenience"
  47. }
  48. )
  49. else
  50. grid['1'].BackgroundColor3 = Color3.fromRGB(
  51. pixels[1][1],
  52. pixels[1][2],
  53. pixels[1][3]
  54. )
  55. for y = 1, resolutionX, 1 do
  56. for x = 1, resolutionY, 1 do
  57. pcall(function()
  58. local pixel = pixels[index]
  59. index = index + 1 -- index += 1 doesn't work wtf
  60. local r = pixels[index][1]
  61. local g = pixels[index][2]
  62. local b = pixels[index][3]
  63. grid[tostring(index)].BackgroundColor3 = Color3.fromRGB(r, g, b)
  64. table.insert(cells, pixel)
  65. end)
  66. end
  67. end
  68. pcall(function()
  69. local pixel = pixels[index]
  70. index = index + 1 -- index += 1 doesn't work wtf
  71. local r = pixels[index][1]
  72. local g = pixels[index][2]
  73. local b = pixels[index][3]
  74. grid[tostring(index)].BackgroundColor3 = Color3.fromRGB(r, g, b)
  75. table.insert(cells, pixel)
  76. end)
  77. game.StarterGui:SetCore(
  78. "SendNotification",
  79. {
  80. Title = "done",
  81. Text = "finished importing, check the drawing grid"
  82. }
  83. )
  84. end
  85. end
  86. import(image)