dasdwdasdawfedcawd

Untitled

Apr 17th, 2025
3,380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. --[[
  2. Spray Paint Auto Draw Script with Image Preview
  3. Controls:
  4. [R] - Show Preview
  5. [T] - Start Auto Draw
  6. [X] - Remove Preview
  7. --]]
  8.  
  9. -- Image URL (can be your image from imgur or similar, must be .png/.jpg)
  10. local imageUrl = "https://chat.openai.com/sandbox:/mnt/data/goodbye_preview.png" -- replace with your uploaded image URL
  11.  
  12. -- GUI Setup
  13. local player = game.Players.LocalPlayer
  14. local previewGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  15. previewGui.Name = "AutoDrawPreview"
  16. previewGui.ResetOnSpawn = false
  17. previewGui.Enabled = false
  18.  
  19. local imageLabel = Instance.new("ImageLabel", previewGui)
  20. imageLabel.Size = UDim2.new(0, 300, 0, 300)
  21. imageLabel.Position = UDim2.new(0.5, -150, 0.5, -150)
  22. imageLabel.BackgroundTransparency = 1
  23. imageLabel.ImageTransparency = 0.3
  24. imageLabel.Image = imageUrl
  25. imageLabel.Visible = false
  26.  
  27. -- Draw data (example)
  28. local drawData = {
  29. {0, 0, 255, 0, 0}, -- red pixel
  30. {1, 0, 0, 255, 0}, -- green pixel
  31. {2, 0, 0, 0, 255}, -- blue pixel
  32. }
  33.  
  34. -- Drawing config
  35. local delay = 0.005
  36. local offsetX = 500
  37. local offsetY = 300
  38. local pixelSize = 2
  39. local lastColor = ""
  40.  
  41. function roundColor(r, g, b)
  42. local step = 17
  43. local function round(v) return math.floor(v / step + 0.5) * step end
  44. return round(r), round(g), round(b)
  45. end
  46.  
  47. function setColor(r, g, b)
  48. local new = table.concat({r, g, b}, ",")
  49. if new ~= lastColor then
  50. game:GetService("ReplicatedStorage").SetSprayColor:FireServer(Color3.fromRGB(r, g, b))
  51. lastColor = new
  52. wait(0.01)
  53. end
  54. end
  55.  
  56. function drawPixel(x, y, r, g, b)
  57. local screenX = offsetX + x * pixelSize
  58. local screenY = offsetY + y * pixelSize
  59. setColor(r, g, b)
  60. mousemoveabs(screenX, screenY)
  61. mouse1click()
  62. wait(delay)
  63. end
  64.  
  65. function startDrawing()
  66. for _, point in ipairs(drawData) do
  67. local x, y, r, g, b = unpack(point)
  68. local rr, gg, bb = roundColor(r, g, b)
  69. drawPixel(x, y, rr, gg, bb)
  70. end
  71. print("✅ Drawing Complete!")
  72. end
  73.  
  74. -- Keybinds
  75. local UIS = game:GetService("UserInputService")
  76. UIS.InputBegan:Connect(function(input, gameProcessed)
  77. if gameProcessed then return end
  78. if input.KeyCode == Enum.KeyCode.R then
  79. previewGui.Enabled = true
  80. imageLabel.Visible = true
  81. elseif input.KeyCode == Enum.KeyCode.X then
  82. previewGui.Enabled = false
  83. imageLabel.Visible = false
  84. elseif input.KeyCode == Enum.KeyCode.T then
  85. previewGui.Enabled = false
  86. imageLabel.Visible = false
  87. startDrawing()
  88. end
  89. end)
  90.  
  91. print("🎨 Press R to preview, T to draw, X to cancel preview.")
  92.  
Advertisement
Add Comment
Please, Sign In to add comment