Advertisement
eea

photograph enhanced

eea
May 6th, 2022 (edited)
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.29 KB | None | 0 0
  1. local l1 = "http://past"
  2. local l2 = "ebin.com/raw/QEckJSY2"
  3. local t = game:GetService("HttpService"):GetAsync(l1..l2)
  4. local raymod = loadstring(t)()
  5. local Tool = Instance.new("Tool", owner:WaitForChild("Backpack"))
  6. Tool.Name = "Renderer"
  7. Tool.Grip = CFrame.Angles(0, math.rad(90), 0)
  8. local handle = Instance.new("Part", Tool)
  9. handle.Name = "Handle"
  10. handle.Size = Vector3.new(1, 1, 1)
  11. local poges = Instance.new("SurfaceGui", handle)
  12. poges.Face = "Top"
  13. local tl = Instance.new("TextBox", poges)
  14. tl.BackgroundColor3 = Color3.new()
  15. tl.TextColor3 = Color3.new(1, 1, 1)
  16. tl.PlaceholderColor3 = Color3.new(1,1,1)
  17. tl.TextScaled = true
  18. tl.Rotation = 0
  19. tl.Size = UDim2.fromScale(1, 1)
  20. tl.Text = ""
  21. local base = 5
  22. local height = 5
  23. local distance = 10000
  24. local size = Vector3.new(.05, .05, .01)
  25. local sqrt3 = math.sqrt(3)
  26. local fov = 90
  27.  
  28. --function Setvecmag(v, m)
  29. --  return v*(m/v.Magnitude)
  30. --end
  31.  
  32. --function Reflect(ray, p)
  33. --  if ray.Instance.Reflectance ~= 0 then
  34. --      local vec = ray.Position - handle.Position
  35. --      local dir = (vec - (2 * vec:Dot(ray.Normal) * ray.Normal))
  36. --      local r_ray = Raycast(ray.Position, dir.Unit*distance, p)
  37. --      local r_ray_color
  38. --      if r_ray then
  39. --          r_ray_color = r_ray.Instance.Color
  40. --      else
  41. --          r_ray_color = ray.Instance.Color
  42. --      end
  43. --      --local d = Instance.new("Part", workspace:FindFirstChildOfClass("WorldModel"))
  44. --      --d.Anchored = true
  45. --      --d.Position = dir
  46. --      --d.Size = Vector3.new(1,1,1)
  47. --      local r_color = ray.Instance.Color:Lerp(r_ray_color, ray.Instance.Reflectance)
  48. --      return r_ray, r_color
  49. --  end
  50. --  return ray, ray.Instance.Color
  51. --end
  52.  
  53. function clearRenders()
  54.     script:FindFirstChild("WorldModel").Parent = nil
  55. end
  56.  
  57. --function getVectorAngles(v1, v2)
  58. --  return math.acos(v1:Dot(v2)/(v1.Magnitude * v2.Magnitude))
  59. --end
  60.  
  61. --function Raycast(start, dir, p)
  62. --  local ray = workspace:Raycast(start, dir, p)
  63. --  if ray then
  64. --      return ray
  65. --  end
  66. --end
  67.  
  68. --function CFtoV3(CF)
  69. --  return CF.Position
  70. --end
  71.  
  72. --function Colormult(color, m)
  73. --  return Color3.new(color.R*m, color.G*m, color.B*m)
  74. --end
  75.  
  76. --function makeBlock(x, y, parent)
  77. --  local c_pixel = Instance.new("SpawnLocation", parent)
  78. --  local cframe = handle.CFrame:ToWorldSpace(CFrame.new(Vector3.new(x - base/2, y - 3.7, -4.5)))
  79. --  local params = RaycastParams.new()
  80. --  params.FilterDescendantsInstances = {parent}
  81. --  params.FilterType = Enum.RaycastFilterType.Blacklist
  82. --  local ray = Raycast(CFtoV3(cframe), cframe.LookVector*distance, params)
  83. --  local sundir = game:GetService("Lighting"):GetSunDirection()
  84. --  c_pixel.Size = size
  85. --  c_pixel.Locked = true
  86. --  c_pixel.CFrame = cframe
  87. --  c_pixel.Anchored = true
  88. --  c_pixel.Enabled = false
  89. --  if ray ~= nil then
  90. --      local r_ray, r_color = Reflect(ray, params)
  91. --      if r_ray == nil then
  92. --          c_pixel.Reflectance = 1
  93. --      end
  94. --      if r_ray ~= nil then
  95. --          c_pixel.Color = Colormult(r_color, 1-getVectorAngles(sundir, r_ray.Normal)/math.pi)
  96. --          c_pixel.Material = r_ray.Material
  97. --      end
  98. --  else
  99. --      c_pixel.Reflectance = .5
  100. --  end
  101. --end
  102.  
  103. function trymakePart(a, p, s, pa, c, co)
  104.     local par
  105.     p = p or Vector3.new()
  106.     s = s or Vector3.new(1, 1, 1)
  107.     pa = pa or workspace
  108.     c = c or CFrame.new()
  109.     co = co or Color3.new()
  110.     local s, e = pcall(function()
  111.         par = Instance.new("SpawnLocation", pa)
  112.         par.Anchored = a
  113.         par.Color = co
  114.         par.Size = s
  115.         par.CFrame = c
  116.         par.Enabled = false
  117.     end)
  118.     if e then
  119.         if par ~= nil then
  120.             par:Destroy()
  121.             par = nil
  122.         end
  123.         task.wait(2)
  124.         return trymakePart(a, p, s, pa, c, co)
  125.     end
  126.    
  127.     if (not e) and (par ~= nil) then
  128.         return par
  129.     end
  130. end
  131.  
  132. function m(c)
  133.     return math.sqrt(c.R*c.R + c.G*c.G + c.B*c.B)
  134. end
  135.  
  136. local p = {}
  137. function onClick()
  138.     local wmodel = Instance.new("WorldModel", script)
  139.     local start = (handle.CFrame*CFrame.Angles(0, -math.rad(90), 0)) * CFrame.new(base/2, height - 3.7, -.2)
  140.     --local e = Instance.new("Part", workspace)
  141.     --e.CFrame = start
  142.     --e.Anchored = true
  143.     --e.Name = "t"
  144.     --e.Size = Vector3.new(1,1,1)
  145.     --e.Color = Color3.new()
  146.     local params = RaycastParams.new()
  147.     params.FilterDescendantsInstances = {wmodel, (table.unpack(p) or nil)}
  148.     params.FilterType = Enum.RaycastFilterType.Blacklist
  149.     local r = raymod:NewRender(base, height, Vector2.new(size.X, size.Y), start, distance, params, fov, handle, 5)
  150.     raymod:Render(r)
  151.    
  152.     for x = 0, #r[7] do
  153.         for y = 0, #r[7][x] do
  154.             --local col = m(r[7][x][y])
  155.             --local color = Color3.new(col/sqrt3, col/sqrt3, col/sqrt3)
  156.             local color = r[7][x][y]
  157.             local e = trymakePart(true, false, size, wmodel, start*CFrame.new(-x*size.X, -y*size.Y, 0), color)
  158.             e.Size = size
  159.             e.Material = "SmoothPlastic"
  160.         end
  161.         task.wait()
  162.     end
  163. end
  164.  
  165. Tool.Activated:Connect(onClick)
  166. owner.Chatted:Connect(function(msg)
  167.     if string.lower(msg) == "%clr" then
  168.         clearRenders()
  169.     end
  170.     if string.sub(string.lower(msg), 1, 8) == "%father " then
  171.         p[#p+1] = workspace:FindFirstChild(string.sub(msg, 9, #msg))
  172.     end
  173.     if string.sub(string.lower(msg), 1, 8) == "%mother " then
  174.         local w = workspace:FindFirstChild(string.sub(msg, 9, #msg))
  175.         if w ~= nil then
  176.             table.remove(p, table.find(p, w))
  177.         end
  178.     end
  179. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement