Scriptorz5

camera

May 5th, 2018 (edited)
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | None | 0 0
  1. me = game.Players.LocalPlayer
  2. char = me.Character
  3. head = char.Head
  4. plrgui = me.PlayerGui
  5. where = 1
  6.  
  7. Pictures = {}
  8.  
  9. for _,v in pairs(plrgui:children()) do
  10. if v.Name == "LOL" then
  11. v:remove()
  12. end
  13. end
  14.  
  15. sc = Instance.new("ScreenGui")
  16. sc.Name = "LOL"
  17.  
  18. function RC(Pos, Dir, Max, Ignore)
  19. return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  20. end
  21.  
  22. function RayC(Start, En, MaxDist, Ignore)
  23. return RC(Start, (En - Start), MaxDist, Ignore)
  24. end
  25.  
  26. UD = UDim2.new
  27. C3 = Color3.new
  28.  
  29. Fog = C3(0.3, 0.4, 0.7)
  30.  
  31. function EditGui(obj, parent, size, position, bgcolor, bordercolor, transparency, text, textcolor, auto)
  32. obj.Size = size
  33. obj.Position = position
  34. obj.BackgroundColor3 = bgcolor
  35. obj.BorderColor3 = bordercolor
  36. obj.BackgroundTransparency = transparency
  37. if obj:IsA("TextLabel") or obj:IsA("TextButton") then
  38. obj.Text = text
  39. obj.TextColor3 = textcolor
  40. end
  41. if obj:IsA("ImageButton") or obj:IsA("TextButton") then
  42. obj.AutoButtonColor = auto
  43. obj.MouseButton1Down:connect(function()
  44. RemoveOptions()
  45. end)
  46. end
  47. obj.Parent = parent
  48. end
  49.  
  50. Resx, Resy = 1028, 768
  51.  
  52. sc.Parent = plrgui
  53. test = Instance.new("Frame")
  54. EditGui(test, sc, UD(1, 0, 1, 0), UD(0, 0, 0, 0), C3(), C3(), 1)
  55. wait(0.15)
  56. Resx, Resy = test.AbsoluteSize.X, test.AbsoluteSize.Y
  57. print(Resx..", "..Resy)
  58. Resx = Resx/5
  59. Resy = Resy/5
  60. test:remove()
  61.  
  62. main = Instance.new("Frame")
  63. EditGui(main, sc, UD(0, Resx, 0, Resy), UD(1, -(Resx)-10, 1, -(Resy)-50), C3(1,1,1), C3(), 0)
  64.  
  65. Num = Instance.new("TextLabel",main)
  66. EditGui(Num, main, UD(0.5, 0, 0, 20), UD(0.25, 0, 0, -24), C3(1,1,1), C3(), 0, 1, C3())
  67.  
  68. Rem = Instance.new("TextButton",main)
  69. EditGui(Rem, main, UD(0.5, 0, 0, 20), UD(0.25, 0, 0, -44), C3(1,1,1), C3(), 0, "Remove", C3(), true)
  70.  
  71.  
  72. Poops = {}
  73.  
  74. for X = 0, Resx, 3 do
  75. for Y = 0, Resy, 3 do
  76. local gui = Instance.new("Frame")
  77. EditGui(gui, main, UD(0, 3, 0, 3), UD(0, X, 0, Y), C3(1,1,0), C3(), 0)
  78. gui.BorderSizePixel = 0
  79. table.insert(Poops, {gui = gui, x = X, y = Y})
  80. end
  81. end
  82.  
  83. cam = workspace.CurrentCamera
  84.  
  85. function place(var)
  86. for i,v in pairs(Pictures) do
  87. if v == var then
  88. return i
  89. end
  90. end
  91. end
  92.  
  93. function loadPic(pic)
  94. for i,v in pairs(Poops) do
  95. v.gui.BackgroundColor3 = pic[i]
  96. end
  97. if place(pic) then
  98. Num.Text = "Pic "..place(pic)
  99. where = place(pic)
  100. end
  101. end
  102.  
  103. function takePic(fro, t)
  104. local pic = {}
  105. for i,v in pairs(Poops) do
  106. local from = fro
  107. local angx = v.x-(Resx/2)
  108. local angy = v.y-(Resy/2)
  109. local to = CFrame.new(from, t) * CFrame.Angles(math.rad(-angy/3), math.rad(-angx/2.6), 0)
  110. to = to * CFrame.new(0, 0, -20).p
  111. local hit, pos = RayC(from, to, 300, char)
  112. local magn = (from - pos).magnitude
  113. local ma = magn/300
  114. ma = (1-ma)
  115. local col = Color3.new(0.5, 0.9, 1)
  116. if hit then
  117. local colo = hit.BrickColor.Color
  118. local r, g, b, r2, g2, b2 = Fog.r, Fog.g, Fog.b, colo.r, colo.g, colo.b
  119. local r3, g3, b3 = r-r2, g-g2, b-b2
  120. col = C3(r-r3*ma, g-g3*ma, b-b3*ma)
  121. else
  122. local tiem = game.Lighting:getMinutesAfterMidnight()
  123. if tiem < 600 or tiem > 2600 then
  124. col = Color3.new(0.05, 0.05, 0.1)
  125. end
  126. end
  127. pic[i] = col
  128. end
  129. table.insert(Pictures, pic)
  130. loadPic(pic)
  131. end
  132.  
  133. Rem.MouseButton1Down:connect(function()
  134. local pic = Pictures[where]
  135. if pic then
  136. table.remove(Pictures, where)
  137. where = where - 1
  138. if where < 1 then
  139. where = 1
  140. end
  141. if Pictures[where] then
  142. loadPic(Pictures[where])
  143. else
  144. Num.Text = "Empty"
  145. for i,v in pairs(Poops) do
  146. v.gui.BackgroundColor3 = Color3.new(1,1,0)
  147. end
  148. end
  149. end
  150. end)
  151.  
  152. if script.Parent.className ~= "HopperBin" then
  153. h = Instance.new("HopperBin", me.Backpack)
  154. h.Name = "Camera"
  155. script.Parent = h
  156. end
  157.  
  158. bin = script.Parent
  159.  
  160. bin.Selected:connect(function(mouse)
  161. mouse.Button1Down:connect(function()
  162. takePic(head.Position, mouse.Hit.p)
  163. end)
  164. mouse.KeyDown:connect(function(key)
  165. key = key:lower()
  166. if #Pictures > 1 then
  167. if key == "q" then
  168. where = where - 1
  169. if where < 1 then
  170. where = #Pictures
  171. end
  172. elseif key == "e" then
  173. where = where + 1
  174. if where > #Pictures then
  175. where = 1
  176. end
  177. end
  178. loadPic(Pictures[where])
  179. end
  180. end)
  181. end)
Add Comment
Please, Sign In to add comment