Advertisement
Aperture10

Untitled

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