A_GUES

rate my avatar script

Aug 4th, 2023
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.47 KB | None | 0 0
  1. _G.Enabled = true
  2. if not _G.Enabled then
  3.     d()
  4. end
  5.  
  6. local camera = game.Workspace.CurrentCamera
  7. local screensize = camera.ViewportSize
  8.  
  9.  
  10. local updater = game:GetService("ReplicatedStorage").CustomiseBooth
  11. function update(text)
  12.     local args = {
  13.         [1] = "Update",
  14.         [2] = {
  15.             ["DescriptionText"] = text,
  16.             ["ImageId"] = 0
  17.         }
  18.     }
  19.  
  20.     updater:FireServer(unpack(args))
  21. end
  22.  
  23. local shirtpooll = {"πŸ§€", "πŸ‘›", "πŸ’š", "πŸ‹"}
  24. local shirtpool = {
  25.     ["πŸ§€"] = "πŸ””",
  26.     ["πŸ‘›"] = "πŸ”΄",
  27.     ["πŸ’š"] = "🌳",
  28.     ["πŸ‹"] = "πŸ”΅",
  29. }
  30.  
  31. local colours = {
  32.     ["πŸ–€"] = {0, 0, 0},
  33.     ["πŸ’Ώ"] = {192, 192, 192},
  34.     ["πŸŒ‘"] = {128, 128, 128},
  35.     ["🀍"] = {255, 255, 255},
  36.     ["πŸ’"]=  {128, 0, 0},
  37.     ["❀️"] = {255, 0, 0},
  38.     ["πŸ’œ"] = {128, 0, 128},
  39.     ["🌸"] = {255, 0, 255},
  40.     ["🌳"] = {0, 128, 0},
  41.     ["πŸ“—"] = {0, 255, 0},
  42.     ["πŸ¦–"] = {128, 128, 0},
  43.     ["πŸ‹"] = {255, 255, 0},
  44.     ["πŸ”΅"] = {0, 0, 128},
  45.     ["πŸ“˜"] = {0, 0, 255},
  46.     ["πŸ§ͺ"] = {0, 128, 128},
  47.     ["πŸ‹"] = {0, 255, 255},
  48. }
  49.  
  50. function getcolorforrange(r, g, b)
  51.     local closestint = 100000000000000000
  52.     local closestcolour = ""
  53.  
  54.     for i, colour in pairs(colours) do
  55.         local totalint = ((r - colour[1])^2) + ((g - colour[2])^2) + ((b - colour[3])^2) ^ (1/2)
  56.         if totalint < closestint then
  57.             closestint = totalint
  58.             closestcolour = i
  59.         end
  60.     end
  61.     return closestcolour
  62. end
  63.  
  64. local mx = 61
  65. local my = 30
  66. while _G.Enabled do
  67.     local topost = ""
  68.     for y=1, screensize.y, math.floor(screensize.y / my) do
  69.         for x=1, screensize.x, math.floor(screensize.x / mx) do
  70.             local ray = camera:ScreenPointToRay(x, y)
  71.             local rayResult = game.Workspace:Raycast(ray.Origin, ray.Direction * 5000)
  72.             local rc
  73.             if rayResult then
  74.                 local ri = rayResult.Instance
  75.                 if ri.Parent:FindFirstChild("Shirt") then
  76.                     if ri.Parent:FindFirstChild("snes") then
  77.                         local sc = ri.Parent.snes.Value
  78.                         topost = topost .. shirtpooll[sc]
  79.                     else
  80.                         local sval = Instance.new("IntValue")
  81.                         sval.Name = "snes"
  82.                         sval.Parent = rayResult.Instance.Parent
  83.                         sval.Value = math.random(1, #shirtpooll)
  84.                         topost = topost .. shirtpooll[sval.Value]
  85.                     end
  86.                 elseif ri.Parent:FindFirstChild("Pants") then
  87.                     if ri.Parent:FindFirstChild("snes") then
  88.                         local sc = ri.Parent.snes.Value
  89.                         topost = topost .. shirtpool[shirtpooll[sc]]
  90.                     else
  91.                         local sval = Instance.new("IntValue")
  92.                         sval.Name = "snes"
  93.                         sval.Parent = rayResult.Instance.Parent
  94.                         sval.Value = math.random(1, #shirtpooll)
  95.                         topost = topost .. shirtpool[shirtpooll[sval.Value]]
  96.                     end
  97.                 else
  98.                     rc = ri.Color
  99.                     topost = topost .. getcolorforrange(rc.R * 255, rc.G * 255, rc.B * 255)
  100.                 end
  101.             else
  102.                 topost = topost .. "πŸ“˜"
  103.             end
  104.         end
  105.         topost = topost .. "\n"
  106.     end
  107.     coroutine.wrap(update)(topost)
  108.     task.wait(.03)
  109. end
Add Comment
Please, Sign In to add comment