Jovey

Color by number auto paint script

Apr 28th, 2022
3,900
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. function GetOwner()
  2. local stringy
  3.  
  4. for i,v in pairs(game:GetService("Workspace").Map.Blocks:GetDescendants()) do
  5. if v.Name == "OwnerFace" and v.Parent.Name == "SpawnLocation" then
  6. if v:FindFirstChild("SurfaceGui"):FindFirstChild("ImageLabel").Image == tostring("rbxthumb://type=AvatarHeadShot&id="..game:GetService("Players").LocalPlayer.UserId.."&w=420&h=420") then
  7. stringy = tostring("rbxthumb://type=AvatarHeadShot&id="..game:GetService("Players").LocalPlayer.UserId.."&w=420&h=420")
  8. end
  9. end
  10. end
  11.  
  12. for i,v in pairs(game:GetService("Workspace").Map.Blocks:GetDescendants()) do
  13. if v.Name == "OwnerFace" and v.Parent.Name == "SpawnLocation" then
  14. if v:FindFirstChild("SurfaceGui"):FindFirstChild("ImageLabel").Image == stringy then
  15. stringy = v
  16. end
  17. end
  18. end
  19. return stringy.Parent.Parent
  20. end
  21.  
  22. local usrPlot = GetOwner()
  23.  
  24. local R = false
  25.  
  26. function Build()
  27. if R == false then
  28. R = true
  29. local remote = game:GetService("ReplicatedStorage").Knit.Services.PixelGeneratorService.RF.DrawPixel
  30. for i,v in pairs(usrPlot:WaitForChild("Draw"):GetChildren()) do -- Replace WaitForChild with FindFirstChild if you want it to be per-execute
  31. task.spawn(function()
  32. if v.Name == "Part" and v:WaitForChild("Texture").Transparency == 0 then
  33. v:FindFirstChild("Texture").Transparency = 0.1 -- To avoid re-painting this and lagging out
  34. task.wait(math.random(0,15)) -- I suggest leaving the max on 15. Lower may lag out, higher will take too long.
  35. remote:InvokeServer(v)
  36. end
  37. end)
  38. end
  39. end
  40. R = false
  41. end
  42.  
  43. function IsNoSurvivors()
  44. local te = 0
  45. for i,v in pairs(GetOwner().Draw:GetChildren()) do
  46. if v.Name == "Part" and v:FindFirstChild("Texture") then
  47. if v.Name == "Part" and v:FindFirstChild("Texture").Transparency ~= 0.75 or v:FindFirstChild("Texture").Transparency ~= 0 then
  48. te = te + 1
  49. end
  50. end
  51. end
  52. return te
  53. end
  54.  
  55. while IsNoSurvivors() ~= 0 do
  56. task.wait()
  57. Build()
  58. end
  59.  
Advertisement
Add Comment
Please, Sign In to add comment