Advertisement
Aperture10

Untitled

Apr 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.88 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(20)
  226. v.Torso.Velocity = torso.CFrame.lookVector * math.huge
  227. end
  228.  
  229.  
  230.  
  231. end
  232.  
  233.  
  234. end
  235.  
  236.  
  237. end
  238.  
  239.  
  240. wait(2)
  241. until human == nil or human.Health < 1 or torso == nil
  242. game:GetService("Debris"):AddItem(c, 2)
  243. end
  244. end)
  245. elseif Mode == "Part" then
  246. Mouse.Target.Archivable = true
  247. local c = Mouse.Target:Clone()
  248. c.Parent = workspace
  249. c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
  250. end
  251. end
  252.  
  253. function WeldFunction()
  254. if Mode == "Model" then
  255. local welds = {}
  256. for _,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
  257. if v:IsA("Part") or v:IsA("WedgePart") then
  258. table.insert(welds, v)
  259. local weld = Instance.new("Weld")
  260. weld.Parent = workspace
  261. weld.Part0 = welds[math.random(#welds)]
  262. weld.Part1 = v
  263. weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  264. end
  265. end
  266. end
  267. end
  268.  
  269. local SizeX = 3
  270. local SizeY = 3
  271. local SizeZ = 3
  272. function BuildFunction()
  273. local p = Instance.new("Part",workspace)
  274. p.CFrame = CFrame.new(Mouse.Hit.p)
  275. p:MakeJoints()
  276. p.Anchored = true
  277. p.Size = Vector3.new(SizeX,SizeY,SizeZ)
  278. end
  279.  
  280. function LaserFunction()
  281. if Mouse.Target.Parent:findFirstChild("Humanoid") then
  282. Mouse.Target.Parent.Humanoid:TakeDamage(25)
  283. end
  284. local Laser = Instance.new("Part",workspace)
  285. Laser.Anchored = true
  286. Laser.BrickColor = BrickColor.new("Really red")
  287. Laser.TopSurface = "Smooth"
  288. Laser.BottomSurface = "Smooth"
  289. Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
  290. Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
  291. game:GetService("Debris"):AddItem(Laser,1)
  292. spawn(function()
  293. repeat
  294. wait()
  295. Laser.Transparency = Laser.Transparency + 0.05
  296. Laser.Size = Laser.Size - Vector3.new(0.05,0,0.05)
  297. until Laser.Transparency > 1
  298. end)
  299. end
  300.  
  301. function ActionFunction()
  302. if Action == "Destroy" then
  303. DestroyFunction()
  304. elseif Action == "Kill" then
  305. KillFunction()
  306. elseif Action == "BreakJoints" then
  307. BreakJointsFunction()
  308. elseif Action == "Distort" then
  309. DistortFunction()
  310. elseif Action == "Anchor" then
  311. AnchorFunction()
  312. elseif Action == "Push" then
  313. PushFunction()
  314. elseif Action == "Freeze" then
  315. FreezeFunction()
  316. elseif Action == "Clone" then
  317. CloneFunction()
  318. elseif Action == "Build" then
  319. BuildFunction()
  320. elseif Action == "Laser" then
  321. LaserFunction()
  322. elseif Action == "Rekt" then
  323. rektFunction()
  324. elseif Action == "Weld" then
  325. WeldFunction()
  326. end
  327. end
  328.  
  329. local GhostPart = Instance.new("Part")
  330. GhostPart.CanCollide = false
  331. GhostPart.Anchored = true
  332. GhostPart.Transparency = 0.5
  333. GhostPart.Size = Vector3.new(3,3,3)
  334.  
  335. local mouseTarget = nil
  336.  
  337. Mouse.Move:connect(function()
  338. Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
  339.  
  340. if Mouse.Target ~= nil then
  341. if Mode == "Part" and not Mouse.Target:IsAncestorOf(Char) then
  342. mouseTarget = Mouse.Target
  343. SB.Adornee = Mouse.Target
  344. elseif Mode == "Model" and mouseTarget ~= Mouse.Target and not Mouse.Target:IsAncestorOf(Char) then
  345. mouseTarget = Mouse.Target
  346. SB.Adornee = getMasterModel(Mouse.Target)--Mouse.Target.Parent
  347. end
  348.  
  349. if Action == "Build" then
  350. GhostPart.Parent = Char
  351. if Mouse.Target ~= GhostPart then
  352. GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
  353. end
  354. elseif Action ~= "Build" then
  355. GhostPart.Parent = nil
  356. end
  357. end
  358. end)
  359.  
  360. Mouse.Button1Down:connect(function()
  361. if Mouse.Target ~= nil then
  362. ActionFunction()
  363. end
  364. end)
  365.  
  366. local keyS = false
  367. local keyW = false
  368. local keyA = false
  369. local keyD = false
  370.  
  371. local speed = 0.7 -- fast is 5
  372.  
  373. Mouse.KeyDown:connect(function(key)
  374. if key == "c" then
  375. Mode = "Part"
  376. elseif key == "v" then
  377. Mode = "Model"
  378. elseif key == "z" then
  379. Selection = Selection + 1
  380. if Selection > #Actions then
  381. Selection = 1
  382. end
  383. Action = Actions[Selection]
  384. elseif key == "x" then
  385. Selection = Selection - 1
  386. if Selection < 1 then
  387. Selection = #Actions
  388. end
  389. Action = Actions[Selection]
  390. end
  391. if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
  392. local GuiSlider = Instance.new("TextButton",ScreenGui)
  393. GuiSlider.Text = "<"
  394. GuiSlider.Size = UDim2.new(0,25,0,25)
  395. GuiSlider.Transparency = 0.3
  396. GuiSlider.BackgroundColor = BrickColor.new("Black")
  397. GuiSlider.TextColor = BrickColor.new("White")
  398. GuiSlider.Position = UDim2.new(0.7,1,0.895,1)
  399. GuiSlider.MouseButton1Down:connect(function()
  400. SizeX = SizeX - 1
  401. if SizeX < 1 then
  402. SizeX = 3
  403. end
  404. end)
  405.  
  406. local GuiSlider = Instance.new("TextButton",ScreenGui)
  407. GuiSlider.Text = ">"
  408. GuiSlider.Size = UDim2.new(0,25,0,25)
  409. GuiSlider.Transparency = 0.3
  410. GuiSlider.BackgroundColor = BrickColor.new("Black")
  411. GuiSlider.TextColor = BrickColor.new("White")
  412. GuiSlider.Position = UDim2.new(0.859,1,0.895,1)
  413. GuiSlider.MouseButton1Down:connect(function()
  414. SizeX = SizeX + 1
  415. if SizeX > 3 then
  416. SizeX = 1
  417. end
  418. end)
  419.  
  420. elseif string.byte(key) == 48 then
  421. speed = 5
  422.  
  423.  
  424. elseif key == "s" then
  425. keyS = true
  426. repeat
  427. wait()
  428. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-speed))
  429. EyeWeld.C0 = CFrame.new(0,0,0.7)
  430. until keyS == false
  431.  
  432.  
  433. elseif key =="w" then
  434. keyW = true
  435. repeat
  436. wait()
  437. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,speed))
  438. EyeWeld.C0 = CFrame.new(0,0,0.7)
  439. until keyW == false
  440.  
  441.  
  442. elseif key =="a" then
  443. keyA = true
  444. repeat
  445. wait()
  446. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(speed,0,0))
  447. until keyA == false
  448.  
  449.  
  450. elseif key =="d" then
  451. keyD = true
  452. repeat
  453. wait()
  454. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-speed,0,0))
  455. until keyD == false
  456.  
  457.  
  458. elseif key == "e" then
  459. Camera.Transparency = math.abs(Camera.Transparency - 1)
  460. end
  461. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  462. end)
  463.  
  464.  
  465. function keyLiftedFunction(key)
  466. print(string.byte(key))
  467.  
  468. if key == "s" then keyS = false end
  469. if key == "a" then keyA = false end
  470. if key == "d" then keyD = false end
  471. if key == "w" then keyW = false end
  472. if string.byte(key) == 48 then speed = 0.7 end
  473. end
  474.  
  475. Mouse.KeyUp:connect(keyLiftedFunction)
  476.  
  477.  
  478.  
  479.  
  480.  
  481. wait(2)
  482. Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement