Advertisement
Aperture10

Untitled

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