Advertisement
Aperture10

Untitled

Apr 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.14 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. v:Destroy()
  31. end
  32. end
  33.  
  34.  
  35. local Camera = Instance.new("Part",Char) -- New character
  36. Camera.Size = Vector3.new(1.5,1.5,1.5)
  37. Camera.Shape = "Ball"
  38. Camera.BrickColor = BrickColor.new("Really black")
  39. Camera.CanCollide = false
  40. Camera.TopSurface = "Smooth"
  41. Camera.BottomSurface = "Smooth"
  42. Camera.Anchored = true
  43. Camera.Locked = true
  44. Camera.CFrame = CFrame.new(0,10,0)
  45. Camera.BackSurface = "Motor"
  46.  
  47. local Eye = Instance.new("Part",Char)
  48. Eye.Size = Vector3.new(0.4,0.4,0.4)
  49. Eye.Shape = "Ball"
  50. Eye.BrickColor = BrickColor.new("White")
  51. Eye.CanCollide = false
  52. Eye.TopSurface = "Smooth"
  53. Eye.BottomSurface = "Smooth"
  54. Eye.Locked = true
  55. Eye:BreakJoints()
  56.  
  57. local EyeWeld = Instance.new("Weld")
  58. EyeWeld.Parent = Char
  59. EyeWeld.Part0 = Eye
  60. EyeWeld.Part1 = Camera
  61. EyeWeld.C0 = CFrame.new(0,0,0.7)
  62.  
  63. --workspace.CurrentCamera.CameraType = "Scriptable"
  64. workspace.CurrentCamera.CameraSubject = Camera
  65.  
  66. function getMasterModel(target)
  67. repeat
  68. wait()
  69. print('check')
  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. if c:findFirstChild("Humanoid") and c:findFirstChild("Torso") then
  188. local human = c.Humanoid
  189. local torso = c.Torso
  190. spawn(function()
  191. repeat
  192. wait(2)
  193. local players = workspace:GetChildren()
  194. for i,v in pairs(players) do
  195. if v:findFirstChild("Humanoid") and v:findFirstChild("Torso") and v ~= c then
  196. print('valid targets')
  197. if (v.Torso.Position - torso.Position).magnitude < 200 then
  198. print('target close enough')
  199. human:MoveTo(v.Torso.Position, v.Torso)
  200. human.WalkSpeed = 20
  201. if (v.Torso.Position - torso.Position).magnitude < 7 then
  202. v.Humanoid:TakeDamage(20)
  203. v.Torso.Velocity = torso.CFrame.lookVector * 250
  204. end
  205. end
  206. end
  207. end
  208. until human == nil or human.Health < 1 or torso == nil
  209. end)
  210. end
  211. elseif Mode == "Part" then
  212. Mouse.Target.Archivable = true
  213. local c = Mouse.Target:Clone()
  214. c.Parent = workspace
  215. c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
  216. end
  217. end
  218.  
  219. function WeldFunction()
  220. if Mode == "Model" then
  221. local welds = {}
  222. for _,v in pairs(getMasterModel(Mouse.Target):GetDescendants()) do
  223. if v:IsA("Part") or v:IsA("WedgePart") then
  224. table.insert(welds, v)
  225. local weld = Instance.new("Weld")
  226. weld.Parent = workspace
  227. weld.Part0 = welds[math.random(#welds)]
  228. weld.Part1 = v
  229. weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  230. end
  231. end
  232. end
  233. end
  234.  
  235. local SizeX = 3
  236. local SizeY = 3
  237. local SizeZ = 3
  238. function BuildFunction()
  239. local p = Instance.new("Part",workspace)
  240. p.CFrame = CFrame.new(Mouse.Hit.p)
  241. p:MakeJoints()
  242. p.Anchored = true
  243. p.Size = Vector3.new(SizeX,SizeY,SizeZ)
  244. end
  245.  
  246. function LaserFunction()
  247. if Mouse.Target.Parent:findFirstChild("Humanoid") then
  248. Mouse.Target.Parent.Humanoid:TakeDamage(25)
  249. end
  250. local Laser = Instance.new("Part",workspace)
  251. Laser.Anchored = true
  252. Laser.BrickColor = BrickColor.new("Really red")
  253. Laser.TopSurface = "Smooth"
  254. Laser.BottomSurface = "Smooth"
  255. Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
  256. Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
  257. game:GetService("Debris"):AddItem(Laser,1)
  258. spawn(function()
  259. repeat
  260. wait()
  261. Laser.Transparency = Laser.Transparency + 0.05
  262. Laser.Size = Laser.Size - Vector3.new(0.05,0,0.05)
  263. until Laser.Transparency > 1
  264. end)
  265. end
  266.  
  267. function ActionFunction()
  268. if Action == "Destroy" then
  269. DestroyFunction()
  270. elseif Action == "Kill" then
  271. KillFunction()
  272. elseif Action == "BreakJoints" then
  273. BreakJointsFunction()
  274. elseif Action == "Distort" then
  275. DistortFunction()
  276. elseif Action == "Anchor" then
  277. AnchorFunction()
  278. elseif Action == "Push" then
  279. PushFunction()
  280. elseif Action == "Freeze" then
  281. FreezeFunction()
  282. elseif Action == "Clone" then
  283. CloneFunction()
  284. elseif Action == "Build" then
  285. BuildFunction()
  286. elseif Action == "Laser" then
  287. LaserFunction()
  288. elseif Action == "Rekt" then
  289. rektFunction()
  290. elseif Action == "Weld" then
  291. WeldFunction()
  292. end
  293. end
  294.  
  295. local GhostPart = Instance.new("Part")
  296. GhostPart.CanCollide = false
  297. GhostPart.Anchored = true
  298. GhostPart.Transparency = 0.5
  299. GhostPart.Size = Vector3.new(3,3,3)
  300.  
  301. local mouseTarget = nil
  302.  
  303. Mouse.Move:connect(function()
  304. Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
  305.  
  306. if Mouse.Target ~= nil then
  307. if Mode == "Part" and mouseTarget ~= Mouse.Target then
  308. mouseTarget = Mouse.Target
  309. SB.Adornee = Mouse.Target
  310. elseif Mode == "Model" and mouseTarget ~= Mouse.Target then
  311. mouseTarget = Mouse.Target
  312. SB.Adornee = getMasterModel(Mouse.Target)--Mouse.Target.Parent
  313. end
  314.  
  315. if Action == "Build" then
  316. GhostPart.Parent = Char
  317. if Mouse.Target ~= GhostPart then
  318. GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
  319. end
  320. elseif Action ~= "Build" then
  321. GhostPart.Parent = nil
  322. end
  323. end
  324. end)
  325.  
  326. Mouse.Button1Down:connect(function()
  327. if Mouse.Target ~= nil then
  328. ActionFunction()
  329. end
  330. end)
  331.  
  332. local keyS = false
  333. local keyW = false
  334. local keyA = false
  335. local keyD = false
  336.  
  337. local speed = 0.7 -- fast is 5
  338.  
  339. Mouse.KeyDown:connect(function(key)
  340. if key == "c" then
  341. Mode = "Part"
  342. elseif key == "v" then
  343. Mode = "Model"
  344. elseif key == "z" then
  345. Selection = Selection + 1
  346. if Selection > #Actions then
  347. Selection = 1
  348. end
  349. Action = Actions[Selection]
  350. elseif key == "x" then
  351. Selection = Selection - 1
  352. if Selection < 1 then
  353. Selection = #Actions
  354. end
  355. Action = Actions[Selection]
  356. end
  357. if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
  358. local GuiSlider = Instance.new("TextButton",ScreenGui)
  359. GuiSlider.Text = "<"
  360. GuiSlider.Size = UDim2.new(0,25,0,25)
  361. GuiSlider.Transparency = 0.3
  362. GuiSlider.BackgroundColor = BrickColor.new("Black")
  363. GuiSlider.TextColor = BrickColor.new("White")
  364. GuiSlider.Position = UDim2.new(0.7,1,0.895,1)
  365. GuiSlider.MouseButton1Down:connect(function()
  366. SizeX = SizeX - 1
  367. if SizeX < 1 then
  368. SizeX = 3
  369. end
  370. end)
  371.  
  372. local GuiSlider = Instance.new("TextButton",ScreenGui)
  373. GuiSlider.Text = ">"
  374. GuiSlider.Size = UDim2.new(0,25,0,25)
  375. GuiSlider.Transparency = 0.3
  376. GuiSlider.BackgroundColor = BrickColor.new("Black")
  377. GuiSlider.TextColor = BrickColor.new("White")
  378. GuiSlider.Position = UDim2.new(0.859,1,0.895,1)
  379. GuiSlider.MouseButton1Down:connect(function()
  380. SizeX = SizeX + 1
  381. if SizeX > 3 then
  382. SizeX = 1
  383. end
  384. end)
  385.  
  386. elseif string.byte(key) == 48 then
  387. speed = 5
  388.  
  389.  
  390. elseif key == "s" then
  391. keyS = true
  392. repeat
  393. wait()
  394. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-speed))
  395. EyeWeld.C0 = CFrame.new(0,0,0.7)
  396. until keyS == false
  397.  
  398.  
  399. elseif key =="w" then
  400. keyW = true
  401. repeat
  402. wait()
  403. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,speed))
  404. EyeWeld.C0 = CFrame.new(0,0,0.7)
  405. until keyW == false
  406.  
  407.  
  408. elseif key =="a" then
  409. keyA = true
  410. repeat
  411. wait()
  412. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(speed,0,0))
  413. until keyA == false
  414.  
  415.  
  416. elseif key =="d" then
  417. keyD = true
  418. repeat
  419. wait()
  420. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-speed,0,0))
  421. until keyD == false
  422.  
  423.  
  424. elseif key == "e" then
  425. Camera.Transparency = math.abs(Camera.Transparency - 1)
  426. end
  427. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  428. end)
  429.  
  430.  
  431. function keyLiftedFunction(key)
  432. print(string.byte(key))
  433.  
  434. if key == "s" then keyS = false end
  435. if key == "a" then keyA = false end
  436. if key == "d" then keyD = false end
  437. if key == "w" then keyW = false end
  438. if string.byte(key) == 48 then speed = 0.7 end
  439. end
  440.  
  441. Mouse.KeyUp:connect(keyLiftedFunction)
  442.  
  443.  
  444.  
  445.  
  446.  
  447. wait(2)
  448. Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement