Advertisement
Aperture10

Untitled

Apr 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.50 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. local Player = game.Players.LocalPlayer
  3. local Char = Player.Character
  4.  
  5. local Mouse = Player:GetMouse()
  6.  
  7. local RealCamera = workspace.CurrentCamera
  8.  
  9. local ScreenGui = Instance.new("ScreenGui",Player.PlayerGui)
  10.  
  11. local Actions = {"Destroy","Kill","BreakJoints","Distort","Anchor","Push","Freeze",
  12. "Clone","Build","Laser","Rekt","Weld"}
  13. local Action = "Destroy"
  14. local Selection = 1
  15. local Mode = "Model"--{"Part","Model"}
  16.  
  17. local GuiM = Instance.new("TextButton",ScreenGui)
  18. GuiM.Size = UDim2.new(0,150,0,25)
  19. GuiM.Position = UDim2.new(0.7,1,0.95,1)
  20. GuiM.Text = "Action: Destroy, Model"
  21. GuiM.BackgroundColor = BrickColor.new("Really black")
  22. GuiM.Transparency = 0.3
  23. GuiM.TextColor = BrickColor.new("White")
  24.  
  25. local SB = Instance.new("SelectionBox",workspace.CurrentCamera)
  26.  
  27. for _,v in pairs(Char:GetChildren()) do
  28. if v:IsA("Part") or v:IsA("Humanoid") or v:IsA("Hat") then
  29. v:Destroy()
  30. end
  31. end
  32.  
  33.  
  34. local Camera = Instance.new("Part",Char) -- New character
  35. Camera.Size = Vector3.new(1.5,1.5,1.5)
  36. Camera.Shape = "Ball"
  37. Camera.BrickColor = BrickColor.new("Really black")
  38. Camera.CanCollide = false
  39. Camera.TopSurface = "Smooth"
  40. Camera.BottomSurface = "Smooth"
  41. Camera.Anchored = true
  42. Camera.Locked = true
  43. Camera.CFrame = CFrame.new(0,10,0)
  44. Camera.BackSurface = "Motor"
  45.  
  46. local Eye = Instance.new("Part",Char)
  47. Eye.Size = Vector3.new(0.4,0.4,0.4)
  48. Eye.Shape = "Ball"
  49. Eye.BrickColor = BrickColor.new("White")
  50. Eye.CanCollide = false
  51. Eye.TopSurface = "Smooth"
  52. Eye.BottomSurface = "Smooth"
  53. Eye.Locked = true
  54. Eye:BreakJoints()
  55.  
  56. local EyeWeld = Instance.new("Weld")
  57. EyeWeld.Parent = Char
  58. EyeWeld.Part0 = Eye
  59. EyeWeld.Part1 = Camera
  60. EyeWeld.C0 = CFrame.new(0,0,0.7)
  61.  
  62. --workspace.CurrentCamera.CameraType = "Scriptable"
  63. workspace.CurrentCamera.CameraSubject = Camera
  64.  
  65. function DestroyFunction()
  66. if Mode == "Model" then
  67. Mouse.Target.Parent:Destroy()
  68. elseif Mode == "Part" then
  69. Mouse.Target:Destroy()
  70. end
  71. end
  72.  
  73. function KillFunction()
  74. if Mouse.Target.Parent:findFirstChild("Humanoid") then
  75. Mouse.Target.Parent.Humanoid.Health = 0
  76. end
  77. end
  78.  
  79. function BreakJointsFunction()
  80. if Mode == "Model" then
  81. Mouse.Target.Parent:BreakJoints()
  82. elseif Mode == "Part" then
  83. Mouse.Target:BreakJoints()
  84. end
  85. end
  86.  
  87. function DistortFunction()
  88. if Mode == "Model" then
  89. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  90. if v:IsA("Part") then
  91. if v.Size.X > 1 and v.Size.Y > 1 and v.Size.Z > 1 then
  92. v.Size = Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z)) + Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z))
  93. v.Color = Color3.new(math.random(),math.random(),math.random())
  94. end
  95. end
  96. end
  97. elseif Mode == "Part" then
  98. local v = Mouse.Target
  99. v.Size = Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z)) + Vector3.new(math.random(v.Size.X),math.random(v.Size.Y),math.random(v.Size.Z))
  100. v.Color = Color3.new(math.random(),math.random(),math.random())
  101. end
  102. end
  103.  
  104. function rektFunction()
  105. if Mode == "Model" then
  106. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  107. if v:IsA("Part") then
  108. v:breakJoints()
  109. v.Anchored = false
  110. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  111. v.Color = Color3.new(math.random(),math.random(),math.random())
  112. end
  113. end
  114. elseif Mode == "Part" then
  115. local v = Mouse.Target
  116. v:breakJoints()
  117. v.Anchored = false
  118. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  119. v.Color = Color3.new(math.random(),math.random(),math.random())
  120. end
  121. end
  122.  
  123. function AnchorFunction()
  124. if Mode == "Model" then
  125. for _,v in pairs (Mouse.Target.Parent:getChildren()) do
  126. if v:IsA("Part") then
  127. v.Anchored = not v.Anchored
  128. end
  129. end
  130. elseif Mode == "Part" then
  131. Mouse.Target.Anchored = not Mouse.Target.Anchored
  132. end
  133. end
  134.  
  135. function PushFunction()
  136. if Mode == "Model" then
  137. for _,v in pairs (Mouse.Target.Parent:getChildren()) do
  138. if v:IsA("Part") then
  139. v.Anchored = not v.Anchored
  140. v.Velocity = Mouse.Target.CFrame.lookVector * 1000
  141. end
  142. end
  143. elseif Mode == "Part" then
  144. Mouse.Target.Anchored = not Mouse.Target.Anchored
  145. Mouse.Target.Velocity = Mouse.Target.CFrame.lookVector * 1000
  146. end
  147. end
  148.  
  149. function FreezeFunction()
  150. if Mode == "Model" then
  151. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  152. if v:IsA("Part") then
  153. v.Anchored = true
  154. v.Material = "Ice"
  155. end
  156. end
  157. elseif Mode == "Part" then
  158. Mouse.Target.Anchored = true
  159. Mouse.Material = "Ice"
  160. end
  161. end
  162.  
  163. function CloneFunction()
  164. if Mode == "Model" then
  165. Mouse.Target.Parent.Archivable = true
  166. local c = Mouse.Target.Parent:Clone()
  167. c.Parent = workspace
  168. c:MoveTo(Mouse.Target.CFrame.p + Vector3.new(0,5,0))
  169. elseif Mode == "Part" then
  170. Mouse.Target.Archivable = true
  171. local c = Mouse.Target:Clone()
  172. c.Parent = workspace
  173. c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
  174. end
  175. end
  176.  
  177. function WeldFunction()
  178. if Mode == "Model" then
  179. local welds = {}
  180. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  181. if v:IsA("Part") then
  182. table.insert(welds, v)
  183. local weld = Instance.new("Weld")
  184. weld.Parent = workspace
  185. weld.Part0 = welds[math.random(#welds)]
  186. weld.Part1 = v
  187. weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  188. end
  189. end
  190. end
  191. end
  192.  
  193. local SizeX = 3
  194. local SizeY = 3
  195. local SizeZ = 3
  196. function BuildFunction()
  197. local p = Instance.new("Part",workspace)
  198. p.CFrame = CFrame.new(Mouse.Hit.p)
  199. p:MakeJoints()
  200. p.Anchored = true
  201. p.Size = Vector3.new(SizeX,SizeY,SizeZ)
  202. end
  203.  
  204. function LaserFunction()
  205. if Mouse.Target.Parent:findFirstChild("Humanoid") then
  206. Mouse.Target.Parent.Humanoid.Health = Mouse.Target.Parent.Humanoid.Health - 25
  207. end
  208. local Laser = Instance.new("Part",workspace)
  209. Laser.Anchored = true
  210. Laser.BrickColor = BrickColor.new("Really red")
  211. Laser.TopSurface = "Smooth"
  212. Laser.BottomSurface = "Smooth"
  213. Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
  214. Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
  215. game:GetService("Debris"):AddItem(Laser,0.5)
  216. end
  217.  
  218. function ActionFunction()
  219. if Action == "Destroy" then
  220. DestroyFunction()
  221. elseif Action == "Kill" then
  222. KillFunction()
  223. elseif Action == "BreakJoints" then
  224. BreakJointsFunction()
  225. elseif Action == "Distort" then
  226. DistortFunction()
  227. elseif Action == "Anchor" then
  228. AnchorFunction()
  229. elseif Action == "Push" then
  230. PushFunction()
  231. elseif Action == "Freeze" then
  232. FreezeFunction()
  233. elseif Action == "Clone" then
  234. CloneFunction()
  235. elseif Action == "Build" then
  236. BuildFunction()
  237. elseif Action == "Laser" then
  238. LaserFunction()
  239. elseif Action == "Rekt" then
  240. rektFunction()
  241. elseif Action == "Weld" then
  242. WeldFunction()
  243. end
  244. end
  245.  
  246. local GhostPart = Instance.new("Part")
  247. GhostPart.CanCollide = false
  248. GhostPart.Anchored = true
  249. GhostPart.Transparency = 0.5
  250. GhostPart.Size = Vector3.new(3,3,3)
  251. Mouse.Move:connect(function()
  252. Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
  253.  
  254. if Mouse.Target ~= nil then
  255. if Mode == "Part" then
  256. SB.Adornee = Mouse.Target
  257. elseif Mode == "Model" then
  258. SB.Adornee = Mouse.Target.Parent
  259. end
  260.  
  261. if Action == "Build" then
  262. GhostPart.Parent = Char
  263. if Mouse.Target ~= GhostPart then
  264. GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
  265. end
  266. elseif Action ~= "Build" then
  267. GhostPart.Parent = nil
  268. end
  269. end
  270. end)
  271.  
  272. Mouse.Button1Down:connect(function()
  273. if Mouse.Target ~= nil then
  274. ActionFunction()
  275. end
  276. end)
  277.  
  278. local keyS = false
  279. local keyW = false
  280. local keyA = false
  281. local keyD = false
  282.  
  283. local speed = 0.7 -- fast is 5
  284.  
  285. Mouse.KeyDown:connect(function(key)
  286. if key == "c" then
  287. Mode = "Part"
  288. elseif key == "v" then
  289. Mode = "Model"
  290. elseif key == "z" then
  291. Selection = Selection + 1
  292. if Selection > #Actions then
  293. Selection = 1
  294. end
  295. Action = Actions[Selection]
  296. elseif key == "x" then
  297. Selection = Selection - 1
  298. if Selection < 1 then
  299. Selection = #Actions
  300. end
  301. Action = Actions[Selection]
  302. end
  303. if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
  304. local GuiSlider = Instance.new("TextButton",ScreenGui)
  305. GuiSlider.Text = "<"
  306. GuiSlider.Size = UDim2.new(0,25,0,25)
  307. GuiSlider.Transparency = 0.3
  308. GuiSlider.BackgroundColor = BrickColor.new("Black")
  309. GuiSlider.TextColor = BrickColor.new("White")
  310. GuiSlider.Position = UDim2.new(0.7,1,0.895,1)
  311. GuiSlider.MouseButton1Down:connect(function()
  312. SizeX = SizeX - 1
  313. if SizeX < 1 then
  314. SizeX = 3
  315. end
  316. end)
  317.  
  318. local GuiSlider = Instance.new("TextButton",ScreenGui)
  319. GuiSlider.Text = ">"
  320. GuiSlider.Size = UDim2.new(0,25,0,25)
  321. GuiSlider.Transparency = 0.3
  322. GuiSlider.BackgroundColor = BrickColor.new("Black")
  323. GuiSlider.TextColor = BrickColor.new("White")
  324. GuiSlider.Position = UDim2.new(0.859,1,0.895,1)
  325. GuiSlider.MouseButton1Down:connect(function()
  326. SizeX = SizeX + 1
  327. if SizeX > 3 then
  328. SizeX = 1
  329. end
  330. end)
  331.  
  332. elseif string.byte(key) == 48 then
  333. speed = 5
  334.  
  335.  
  336. elseif key == "s" then
  337. keyS = true
  338. repeat
  339. wait()
  340. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-speed))
  341. EyeWeld.C0 = CFrame.new(0,0,0.7)
  342. until keyS == false
  343.  
  344.  
  345. elseif key =="w" then
  346. keyW = true
  347. repeat
  348. wait()
  349. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,speed))
  350. EyeWeld.C0 = CFrame.new(0,0,0.7)
  351. until keyW == false
  352.  
  353.  
  354. elseif key =="a" then
  355. keyA = true
  356. repeat
  357. wait()
  358. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(speed,0,0))
  359. until keyA == false
  360.  
  361.  
  362. elseif key =="d" then
  363. keyD = true
  364. repeat
  365. wait()
  366. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-speed,0,0))
  367. until keyD == false
  368.  
  369.  
  370. elseif key == "e" then
  371. Camera.Transparency = math.abs(Camera.Transparency - 1)
  372. end
  373. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  374. end)
  375.  
  376.  
  377. function keyLiftedFunction(key)
  378. print(string.byte(key))
  379.  
  380. if key == "s" then keyS = false end
  381. if key == "a" then keyA = false end
  382. if key == "d" then keyD = false end
  383. if key == "w" then keyW = false end
  384. if string.byte(key) == 48 then speed = 0.7 end
  385. end
  386.  
  387. Mouse.KeyUp:connect(keyLiftedFunction)
  388.  
  389.  
  390.  
  391.  
  392.  
  393. wait(2)
  394. Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement