Advertisement
Aperture10

Untitled

Apr 28th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.33 KB | None | 0 0
  1.  
  2.  
  3. --Designed and Coded by Kangerujack 2016
  4. --Revisioned 2018
  5.  
  6.  
  7. ----------------------Local Variables----------------------------
  8.  
  9.  
  10. local Player = game.Players.LocalPlayer
  11.  
  12. local Mouse = Player:GetMouse()
  13.  
  14. local RealCamera = workspace.CurrentCamera
  15.  
  16.  
  17. local Actions = {"Destroy","Kill","BreakJoints","Distort","Anchor","Push","Freeze",
  18. "Clone","Build","Laser","Rekt","Weld"}
  19. local Action = "Destroy"
  20. local Selection = 1
  21. local Mode = "Model"--{"Part","Model"}
  22.  
  23. local punishedPlayers = {}
  24.  
  25. table.sort(Actions)
  26.  
  27.  
  28. local SizeX = 3
  29. local SizeY = 3
  30. local SizeZ = 3
  31.  
  32. local menuUp = false
  33.  
  34. --if Player.Name ~= "Player1" then
  35. --repeat
  36. --wait(100000000)
  37. --until false
  38. --end
  39.  
  40. ---------------------------CLEAN UP------------------------------
  41.  
  42. --RealCamera:ClearAllChildren()
  43. --Player.PlayerGui:ClearAllChildren()
  44.  
  45. function freshLoad()
  46.  
  47. Char = workspace:WaitForChild(Player.Name)
  48.  
  49. for _,v in pairs(Char:GetChildren()) do
  50. print("Checking: "..v.Name)
  51. if v:IsA("Part") or v:IsA("Humanoid") or v:IsA("Hat") then
  52. print("Destroying part: "..v.Name)
  53. v:Destroy()
  54. end
  55. end
  56.  
  57.  
  58. Camera = Instance.new("Part",Char) -- New character
  59. Camera.Size = Vector3.new(1.5,1.5,1.5)
  60. Camera.Shape = "Ball"
  61. Camera.BrickColor = BrickColor.new("Really black")
  62. Camera.CanCollide = false
  63. Camera.TopSurface = "Smooth"
  64. Camera.BottomSurface = "Smooth"
  65. Camera.Anchored = true
  66. Camera.Locked = true
  67. Camera.CFrame = CFrame.new(0,10,0)
  68. Camera.BackSurface = "Motor"
  69. Camera.Name = "Eye"
  70.  
  71. Eye = Instance.new("Part",Char)
  72. Eye.Size = Vector3.new(0.4,0.4,0.4)
  73. Eye.Shape = "Ball"
  74. Eye.BrickColor = BrickColor.new("White")
  75. Eye.CanCollide = false
  76. Eye.TopSurface = "Smooth"
  77. Eye.BottomSurface = "Smooth"
  78. Eye.Locked = true
  79. Eye:BreakJoints()
  80.  
  81. EyeWeld = Instance.new("Weld")
  82. EyeWeld.Parent = Char
  83. EyeWeld.Part0 = Eye
  84. EyeWeld.Part1 = Camera
  85. EyeWeld.C0 = CFrame.new(0,0,0.7)
  86.  
  87. ScreenGui = Instance.new("ScreenGui",Player.PlayerGui) ----------------------BASIC GUI---------------------------------
  88.  
  89. GuiM = Instance.new("TextButton",ScreenGui)
  90. GuiM.Size = UDim2.new(0,250,0,50)
  91. GuiM.Position = UDim2.new(0.7,1,0.8,1) --0.95= 5
  92. GuiM.Text = "Action: Destroy, Model"
  93. GuiM.BackgroundColor = BrickColor.new("Really black")
  94. GuiM.Transparency = 0.3
  95. GuiM.TextColor = BrickColor.new("White")
  96.  
  97. SB = Instance.new("SelectionBox",workspace.CurrentCamera)
  98.  
  99. workspace.CurrentCamera.CameraSubject = Camera
  100.  
  101. local guiAnimating = false
  102.  
  103. GuiM.MouseButton1Click:connect(function()
  104.  
  105. if guiAnimating == true then return end
  106.  
  107.  
  108.  
  109. function closeGui()
  110. for i,v in pairs(ActionsGui) do
  111. spawn(function()
  112. ActionsGui[i].Text = ""
  113. repeat
  114. guiAnimating = true
  115. wait()
  116. ActionsGui[i].Size = UDim2.new(0,ActionsGui[i].Size.X.Offset - 15,0,ActionsGui[i].Size.Y.Offset)
  117. until ActionsGui[i].Size.X.Offset < 1
  118. ActionsGui[i]:Destroy()
  119. guiAnimating = false
  120. menuUp = false
  121. end)
  122. end
  123. end
  124.  
  125. if menuUp == true then
  126.  
  127. closeGui()
  128.  
  129. return --Don't do it
  130.  
  131. end
  132.  
  133. if guiMenu ~= nil then
  134. guiMenu:Destroy()
  135. end
  136.  
  137. guiMenu = Instance.new("Folder",ScreenGui)
  138.  
  139. menuUp = true
  140.  
  141. local selectionGui = nil
  142. local selectionGuiMode = nil
  143.  
  144.  
  145.  
  146.  
  147.  
  148. ActionsGui = {}
  149. for i,v in pairs(Actions) do
  150. local gui = Instance.new("TextButton",guiMenu)
  151. gui.Size = UDim2.new(0,125,0,25)
  152. gui.Position = GuiM.Position + UDim2.new(0,0,0,-25 * i)
  153. gui.Text = v
  154. gui.BackgroundColor = BrickColor.new("Really black")
  155. gui.Transparency = 0.3
  156. gui.TextColor = BrickColor.new("White")
  157.  
  158. if v == Action then
  159. gui.BackgroundColor = BrickColor.new("Really red") ---------------------Selects the action in use
  160. selectionGui = gui
  161. end
  162.  
  163. gui.MouseButton1Click:connect(function()
  164. if selectionGui == nil then
  165. gui.BackgroundColor = BrickColor.new("Really red")
  166. selectionGui = gui
  167. else
  168. selectionGui.BackgroundColor = BrickColor.new("Really black")
  169. gui.BackgroundColor = BrickColor.new("Really red")
  170. selectionGui = gui
  171. end
  172. end)
  173. table.insert(ActionsGui, gui)
  174. end
  175.  
  176.  
  177. for i = 1, 2 do
  178. local gui = Instance.new("TextButton",guiMenu)
  179. gui.Size = UDim2.new(0,125,0,25)
  180. gui.Position = GuiM.Position + UDim2.new(0,125,0,-25 * i)
  181.  
  182. gui.BackgroundColor = BrickColor.new("Really black")
  183. gui.Transparency = 0.3
  184. gui.TextColor = BrickColor.new("White")
  185. if i == 1 then
  186. gui.Text = "Part"
  187. else
  188. gui.Text = "Model"
  189. gui.BackgroundColor = BrickColor.new("Really red")
  190. selectionGuiMode = gui
  191. end
  192.  
  193. gui.MouseButton1Click:connect(function()
  194. if selectionGuiMode == nil then
  195. gui.BackgroundColor = BrickColor.new("Really red")
  196. selectionGuiMode = gui
  197. else
  198. selectionGuiMode.BackgroundColor = BrickColor.new("Really black")
  199. gui.BackgroundColor = BrickColor.new("Really red")
  200. selectionGuiMode = gui
  201. end
  202. end)
  203.  
  204. table.insert(ActionsGui, gui)
  205. end
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213. local gui = Instance.new("TextButton",guiMenu) ----------------Okay we will change what mode we are in!
  214. gui.Size = UDim2.new(0,50,0,25)
  215. gui.Position = GuiM.Position + UDim2.new(0,250,0,0)
  216. gui.Text = "Okay"
  217. gui.BackgroundColor = BrickColor.new("Bright green")
  218. gui.Transparency = 0.3
  219. gui.TextColor = BrickColor.new("White")
  220. gui.MouseButton1Click:connect(function()
  221.  
  222. Action = selectionGui.Text
  223. Mode = selectionGuiMode.Text
  224.  
  225. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  226.  
  227. closeGui()
  228. end)
  229.  
  230. table.insert(ActionsGui, gui)
  231.  
  232. local gui = Instance.new("TextButton",guiMenu)
  233. gui.Size = UDim2.new(0,50,0,25)
  234. gui.Position = GuiM.Position + UDim2.new(0,250,0,25)
  235. gui.Text = "Cancel"
  236. gui.BackgroundColor = BrickColor.new("Bright red")
  237. gui.Transparency = 0.3
  238. gui.TextColor = BrickColor.new("White")
  239. gui.MouseButton1Click:connect(closeGui)
  240.  
  241. table.insert(ActionsGui, gui)
  242.  
  243. local gui = Instance.new("TextButton",guiMenu) ----------------------------------PROGRAMS MARK-----------------------------------------||||
  244. gui.Size = UDim2.new(0,75,0,25)
  245. gui.Position = GuiM.Position + UDim2.new(0,-75,0,25)
  246. gui.Text = "Programs"
  247. gui.BackgroundColor = BrickColor.new("Bright red")
  248. gui.Transparency = 0.3
  249. gui.TextColor = BrickColor.new("White")
  250. table.insert(ActionsGui, gui)
  251.  
  252. gui.MouseButton1Click:connect(function() -------------------------------------Track Player Function------------------------------------------
  253. local gui = Instance.new("TextButton",guiMenu)
  254. gui.Size = UDim2.new(0,75,0,25)
  255. gui.Position = GuiM.Position + UDim2.new(0,-75,0,0)
  256. gui.Text = "Track"
  257. gui.BackgroundColor = BrickColor.new("Bright green")
  258. gui.Transparency = 0.3
  259. gui.TextColor = BrickColor.new("White")
  260. table.insert(ActionsGui, gui)
  261.  
  262.  
  263. gui.MouseButton1Click:connect(function() -------------------------------------------------Load players---------------------------------
  264. for i,v in pairs(game.Players:GetPlayers()) do
  265. local gui = Instance.new("TextButton",guiMenu)
  266. gui.Size = UDim2.new(0,75,0,25)
  267. gui.Position = GuiM.Position + UDim2.new(0,-150,0,(-25 * i) + 25)
  268. gui.Text = v.Name
  269. gui.BackgroundColor = BrickColor.new("Really black")
  270. gui.Transparency = 0.3
  271. gui.TextColor = BrickColor.new("White")
  272. table.insert(ActionsGui, gui)
  273. gui.MouseButton1Click:connect(function() -------When they select a player
  274. if game.Players:findFirstChild(gui.Text) then
  275. local targetPlayer = game.Players[gui.Text]
  276. if targetPlayer.Character:findFirstChild("Head") and targetPlayer.Character:findFirstChild("Humanoid") then
  277.  
  278.  
  279.  
  280. RealCamera.CameraSubject = targetPlayer.Character.Head
  281. closeGui()
  282.  
  283. local gui = Instance.new("TextButton",ScreenGui)
  284. gui.Size = UDim2.new(0,75,0,50)
  285. gui.Position = GuiM.Position + UDim2.new(0,-200,0,0)
  286. gui.Text = "Exit Tracker"
  287. gui.BackgroundColor = BrickColor.new("Really red")
  288. gui.Transparency = 0.3
  289. gui.TextColor = BrickColor.new("White")
  290. gui.MouseButton1Click:connect(function()
  291. RealCamera.CameraSubject = Camera
  292. gui:Destroy()
  293. end)
  294.  
  295.  
  296. spawn(function()
  297. repeat
  298. wait(1)
  299.  
  300. --Conditions to check to make sure we don't get locked in
  301. if RealCamera.CameraSubject ~= targetPlayer.Character.Head then
  302. break
  303. end
  304.  
  305.  
  306. if workspace:findFirstChild(targetPlayer.Name) == nil then
  307. break
  308. end
  309.  
  310. if targetPlayer.Character:findFirstChild("Humanoid") == nil then
  311. break
  312. end
  313.  
  314. if targetPlayer.Character.Humanoid.Health < 1 then
  315. break
  316. end
  317. until false
  318. RealCamera.CameraSubject = Camera
  319. gui:Destroy()
  320. end)
  321. end
  322. end
  323. end)
  324. end
  325. end)
  326.  
  327.  
  328. local gui = Instance.new("TextButton",guiMenu) ----------------------------------------Punish Player---------------------------
  329. gui.Size = UDim2.new(0,75,0,25)
  330. gui.Position = GuiM.Position + UDim2.new(0,-75,0,-25)
  331. gui.Text = "Punish"
  332. gui.BackgroundColor = BrickColor.new("Bright green")
  333. gui.Transparency = 0.3
  334. gui.TextColor = BrickColor.new("White")
  335. table.insert(ActionsGui, gui)
  336.  
  337.  
  338. gui.MouseButton1Click:connect(function() ----------------------------------------Punish Player------------------------
  339. for i,v in pairs(game.Players:GetChildren()) do
  340. local gui = Instance.new("TextButton",guiMenu)
  341. gui.Size = UDim2.new(0,75,0,25)
  342. gui.Position = GuiM.Position + UDim2.new(0,-151,0,-25* i)
  343. gui.Text = v.Name
  344. gui.Transparency = 0.3
  345. gui.TextColor = BrickColor.new("White")
  346. table.insert(ActionsGui, gui)
  347.  
  348. for i,x in pairs(punishedPlayers) do
  349. print(gui.Text,x)
  350. if gui.Text == x then
  351. gui.BackgroundColor = BrickColor.new("Really red")
  352. break
  353. else
  354. gui.BackgroundColor = BrickColor.new("Really black")
  355. end
  356. end
  357.  
  358.  
  359. gui.MouseButton1Click:connect(function()
  360. if gui.BackgroundColor == BrickColor.new("Really red") then
  361. gui.BackgroundColor = BrickColor.new("Really black")
  362. for i,x in pairs(punishedPlayers) do
  363. if x == gui.Text then
  364. table.remove(punishedPlayers, i)
  365. return
  366. end
  367. end
  368. end
  369.  
  370. if game.Players:FindFirstChild(gui.Text) then
  371. gui.BackgroundColor = BrickColor.new("Really red")
  372. table.insert(punishedPlayers, gui.Text)
  373. local punishTarget = gui.Text
  374. spawn(function()
  375. repeat
  376. wait(0.5)
  377. game.Players[punishTarget].Character:Destroy()
  378. print('destroying player: '..punishTarget)
  379. for i,x in pairs(punishedPlayers) do
  380. if x == punishTarget then
  381. print('player still in punishment')
  382. break
  383. elseif i == #punishedPlayers then
  384. print('player not in punishment anymore')
  385. return
  386. end
  387. end
  388. if #punishedPlayers == 0 then
  389. return
  390. end
  391. until game.Players:findFirstChild(punishTarget) == nil
  392. end)
  393. end
  394. end)
  395. end
  396. end)
  397.  
  398.  
  399.  
  400.  
  401.  
  402. end)
  403.  
  404. end)
  405.  
  406. end
  407.  
  408. freshLoad()
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420. local GhostPart = Instance.new("Part")
  421. GhostPart.CanCollide = false
  422. GhostPart.Anchored = true
  423. GhostPart.Transparency = 0.5
  424. GhostPart.Size = Vector3.new(SizeX,SizeY,SizeZ)
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432. --workspace.CurrentCamera.CameraType = "Scriptable"
  433.  
  434.  
  435. function getMasterModel(target)
  436. repeat
  437. wait()
  438.  
  439. if Char:IsAncestorOf(target) or menuUp or target == nil then
  440. return nil
  441. end
  442.  
  443.  
  444.  
  445. if target.Parent ~= workspace then
  446. target = target.Parent
  447. else
  448. if target.Name == "Base" then return nil end --We don't want to mess with the baseplate
  449. return target
  450. end
  451. until target == false
  452. end
  453.  
  454.  
  455.  
  456. -------------------------------------------------------------------------------MAIN FUNCTIONS MARK-------------------------------------
  457.  
  458.  
  459.  
  460.  
  461. function DestroyFunction()
  462. SB.Adornee:Destroy()
  463. end
  464.  
  465. function KillFunction()
  466. for i,v in pairs(SB.Adornee:GetDescendants()) do
  467. if v:IsA("Humanoid") then
  468. v.Health = 0
  469. v:Destroy()
  470. end
  471. end
  472. end
  473.  
  474. function BreakJointsFunction()
  475. SB.Adornee:BreakJoints()
  476.  
  477. end
  478.  
  479. function DistortFunction()
  480. --if Mode == "Model" then
  481. print(SB.Adornee.ClassName)
  482. for _,v in pairs(SB.Adornee:GetDescendants()) do
  483. if v:IsA("Part","WedgePart","UnionOperation") then
  484. 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))
  485. end
  486. end
  487. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  488. SB.Adornee.Size = Vector3.new(math.random(SB.Adornee.Size.X),math.random(SB.Adornee.Size.Y),math.random(SB.Adornee.Size.Z)) +
  489. Vector3.new(math.random(SB.Adornee.Size.X),math.random(SB.Adornee.Size.Y),math.random(SB.Adornee.Size.Z))
  490. end
  491. end
  492.  
  493. function rektFunction()
  494. for _,v in pairs(SB.Adornee:GetDescendants()) do
  495. if v:IsA("Part","WedgePart","UnionOperation") then
  496. v:breakJoints()
  497. v.Anchored = false
  498. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  499. v.Color = Color3.new(math.random(),math.random(),math.random())
  500. end
  501. end
  502. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  503. local v = SB.Adornee
  504. v:breakJoints()
  505. v.Anchored = false
  506. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  507. v.Color = Color3.new(math.random(),math.random(),math.random())
  508. end
  509. end
  510.  
  511. function AnchorFunction()
  512. for _,v in pairs (SB.Adornee:GetDescendants()) do
  513. if v:IsA("Part","WedgePart","UnionOperation") then
  514. v.Anchored = not v.Anchored
  515. end
  516. end
  517. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  518. SB.Adornee.Anchored = not SB.Adornee.Anchored
  519. end
  520. end
  521.  
  522. function PushFunction()
  523. for _,v in pairs (SB.Adornee:GetDescendants()) do
  524. if v:IsA("Part","WedgePart","UnionOperation") then
  525. v.Anchored = false
  526. v.Velocity = Mouse.Target.CFrame.lookVector * 1000
  527. end
  528. end
  529. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  530. SB.Adornee.Anchored = false
  531. SB.Adornee.Velocity = Mouse.Target.CFrame.lookVector * 1000
  532. end
  533. end
  534.  
  535. function FreezeFunction()
  536. for _,v in pairs(SB.Adornee:GetDescendants()) do
  537. if v:IsA("Part","WedgePart","UnionOperation") then
  538. v.BrickColor = BrickColor.new("Pastel Blue")
  539. v.Anchored = true
  540. v.Material = "Ice"
  541. end
  542. end
  543. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  544. SB.Adornee.Anchored = true
  545. SB.Adornee.Material = "Ice"
  546. end
  547. end
  548.  
  549. function CloneFunction()
  550. SB.Adornee.Archivable = true
  551. local c = SB.Adornee:Clone()
  552. c.Parent = workspace
  553. c:MakeJoints()
  554.  
  555. if c.ClassName == "Model" then
  556. c:MoveTo(Mouse.Target.CFrame.p + Vector3.new(0,5,0))
  557. elseif c:IsA("Part","WedgePart","UnionOperation") then
  558. c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
  559. end
  560.  
  561.  
  562. spawn(function()
  563.  
  564. if c:findFirstChild("Humanoid") and c:findFirstChild("Torso") then
  565. local human = c.Humanoid
  566. local torso = c.Torso
  567.  
  568. human.Archivable = true
  569.  
  570. local bp = Instance.new("BodyPosition",torso)
  571. bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  572. bp.Position = torso.Position
  573.  
  574. if c:findFirstChild("Right Arm") and c:findFirstChild("Left Arm") then ---Put the arms up like a zombie
  575. local zarm1 = c["Right Arm"]
  576. local zarm2 = c["Left Arm"]
  577.  
  578. local weld = Instance.new("Weld",c)
  579. weld.Part0 = torso
  580. weld.Part1 = zarm2
  581. weld.C0 = CFrame.new(-1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) --Left arm
  582.  
  583. local weld = Instance.new("Weld",c)
  584. weld.Part0 = torso
  585. weld.Part1 = zarm1
  586. weld.C0 = CFrame.new(1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) --Right arm
  587.  
  588. local function touchChaos(hit)
  589.  
  590.  
  591. if hit.Name == c.Name then return end
  592. if getMasterModel(hit).Name == c.Name then return end
  593. if hit.Parent == c then return end
  594. if hit.Parent:findFirstChild("Torso") then
  595. if hit.Parent.Torso:findFirstChild("BodyPosition") then
  596. return ----Don't hurt other clones
  597. end
  598. end
  599.  
  600. print('touched '..hit.Name..'parent of '..hit.Parent.Name..'I AM: '..c.Name)
  601.  
  602. if hit.Parent:findFirstChild("Humanoid") then
  603. hit.Parent.Humanoid:Destroy()
  604. elseif hit.Parent ~= workspace and hit.BrickColor ~= BrickColor.new("Really red") then
  605. for i,v in pairs(getMasterModel(hit):GetDescendants()) do
  606. if v:IsA("Part") or v:IsA("WedgePart") then
  607. v:breakJoints()
  608. v.Anchored = false
  609. v.Velocity = Vector3.new(math.random(-250,250),math.random(-250,250),math.random(-250,250))
  610. v.BrickColor = BrickColor.new("Really red")
  611. end
  612. end
  613. game:GetService("Debris"):AddItem(getMasterModel(hit), 5)
  614. elseif hit:IsA("Part") and hit.Name ~= "Base" then
  615. hit:Destroy()
  616. end
  617. end
  618.  
  619. zarm1.Touched:connect(touchChaos)
  620. zarm2.Touched:connect(touchChaos)
  621. end
  622.  
  623. repeat
  624.  
  625. local targets = {}
  626.  
  627. local players = workspace:GetChildren()
  628.  
  629.  
  630.  
  631. local enemyTorso = nil
  632. local enemyHuman = nil
  633. local enemyTorsoDistance = nil
  634.  
  635. for i,v in pairs(players) do
  636.  
  637.  
  638. if v:findFirstChild("Humanoid") and v:findFirstChild("Torso") and v ~= c and v.Name ~= c.Name then
  639.  
  640.  
  641. if (v.Torso.Position - torso.Position).magnitude < 200 and v.Humanoid.Health > 0 and
  642. v.Torso:findFirstChild("BodyPosition") == nil then
  643.  
  644. enemyTorsoDistance = (v.Torso.Position - torso.Position).magnitude
  645. enemyTorso = v.Torso
  646. enemyHuman = v.Humanoid
  647.  
  648. table.insert(targets, enemyTorso)
  649.  
  650.  
  651. end
  652. end
  653. end
  654.  
  655. if #targets > 0 then
  656. local target = targets[math.random(#targets)]
  657. print("Target: "..target.Parent.Name.."I am: "..c.Name)
  658. human:MoveTo(target.Position, target)
  659. human.WalkSpeed = 20
  660. human.Jump = true
  661. bp.Position = target.Position
  662. end
  663.  
  664.  
  665. wait(2)
  666.  
  667.  
  668.  
  669. until human == nil or human.Health < 1 or torso == nil
  670. game:GetService("Debris"):AddItem(c, 0.1)
  671. end
  672. end)
  673. end
  674.  
  675. function WeldFunction()
  676. local welds = {}
  677. for _,v in pairs(SB.Adornee:GetDescendants()) do
  678. if v:IsA("Part","WedgePart","UnionOperation") then
  679. table.insert(welds, v)
  680. local weld = Instance.new("Weld")
  681. weld.Parent = workspace
  682. weld.Part0 = welds[math.random(#welds)]
  683. weld.Part1 = v
  684. weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  685. end
  686. end
  687. end
  688.  
  689.  
  690. function BuildFunction()
  691. local p = Instance.new("Part",workspace)
  692. p.CFrame = GhostPart.CFrame
  693. p:MakeJoints()
  694. p.Anchored = true
  695. p.Size = Vector3.new(SizeX,SizeY,SizeZ)
  696. end
  697.  
  698. function LaserFunction()
  699. if SB.Adornee:findFirstChild("Humanoid") then
  700. SB.Adornee.Humanoid:TakeDamage(25)
  701. end
  702. local Laser = Instance.new("Part",workspace)
  703. Laser.Anchored = true
  704. Laser.BrickColor = BrickColor.new("Really red")
  705. Laser.TopSurface = "Smooth"
  706. Laser.BottomSurface = "Smooth"
  707. Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
  708. Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
  709. game:GetService("Debris"):AddItem(Laser,1)
  710. spawn(function()
  711. repeat
  712. wait()
  713. Laser.Transparency = Laser.Transparency + 0.05
  714. Laser.Size = Laser.Size - Vector3.new(0.05,0,0.05)
  715. until Laser.Transparency > 1
  716. end)
  717. end
  718.  
  719. function ActionFunction()
  720. if Action == "Destroy" then
  721. DestroyFunction()
  722. elseif Action == "Kill" then
  723. KillFunction()
  724. elseif Action == "BreakJoints" then
  725. BreakJointsFunction()
  726. elseif Action == "Distort" then
  727. DistortFunction()
  728. elseif Action == "Anchor" then
  729. AnchorFunction()
  730. elseif Action == "Push" then
  731. PushFunction()
  732. elseif Action == "Freeze" then
  733. FreezeFunction()
  734. elseif Action == "Clone" then
  735. CloneFunction()
  736. elseif Action == "Build" then
  737. BuildFunction()
  738. elseif Action == "Laser" then
  739. LaserFunction()
  740. elseif Action == "Rekt" then
  741. rektFunction()
  742. elseif Action == "Weld" then
  743. WeldFunction()
  744. end
  745. end
  746.  
  747.  
  748.  
  749. local mouseTarget = nil
  750.  
  751. Mouse.Move:connect(function()
  752.  
  753. if Player.Character:findFirstChild("Eye") == nil then freshLoad() end
  754. if workspace:findFirstChild(Player.Name) == nil then freshLoad() end
  755.  
  756.  
  757. Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
  758.  
  759. if Mouse.Target ~= nil then
  760.  
  761. if mouseTarget == Mouse.Target then --Don't waste resources when we already have what we want
  762. return
  763. end
  764.  
  765.  
  766.  
  767. if Mode == "Part" then
  768. mouseTarget = Mouse.Target
  769. SB.Adornee = Mouse.Target
  770. elseif Mode == "Model" then
  771. mouseTarget = Mouse.Target
  772. SB.Adornee = getMasterModel(Mouse.Target)--Mouse.Target.Parent
  773. end
  774.  
  775. if Action == "Build" then
  776. GhostPart.Parent = Char
  777. if Mouse.Target ~= GhostPart then
  778. GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
  779. end
  780. elseif Action ~= "Build" then
  781. GhostPart.Parent = nil
  782. end
  783.  
  784. else
  785. SB.Adornee = nil
  786. end
  787. end)
  788.  
  789. Mouse.Button1Down:connect(function()
  790. if Mouse.Target ~= nil then
  791. ActionFunction()
  792. end
  793. end)
  794.  
  795. local keyS = false
  796. local keyW = false
  797. local keyA = false
  798. local keyD = false
  799.  
  800. local speed = 0.7 -- fast is 5
  801.  
  802. GuiSlider2 = nil
  803. GuiSlider1 = nil
  804.  
  805. Mouse.KeyDown:connect(function(key)
  806. if key == "c" then
  807. Mode = "Part"
  808. elseif key == "v" then
  809. Mode = "Model"
  810. elseif key == "z" then
  811. Selection = Selection + 1
  812. if Selection > #Actions then
  813. Selection = 1
  814. end
  815. Action = Actions[Selection]
  816. elseif key == "x" then
  817. Selection = Selection - 1
  818. if Selection < 1 then
  819. Selection = #Actions
  820. end
  821. Action = Actions[Selection]
  822. end
  823.  
  824. if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
  825. GuiSlider1 = Instance.new("TextButton",ScreenGui)
  826. GuiSlider1.Text = "<"
  827. GuiSlider1.Size = UDim2.new(0,25,0,25)
  828. GuiSlider1.Transparency = 0.3
  829. GuiSlider1.BackgroundColor = BrickColor.new("Black")
  830. GuiSlider1.TextColor = BrickColor.new("White")
  831. GuiSlider1.Position = UDim2.new(0.7,1,0.895,1)
  832. GuiSlider1.MouseButton1Down:connect(function()
  833. SizeX = SizeX - 1
  834. if SizeX < 1 then
  835. SizeX = 3
  836. end
  837. end)
  838.  
  839. GuiSlider2 = Instance.new("TextButton",ScreenGui)
  840. GuiSlider2.Text = ">"
  841. GuiSlider2.Size = UDim2.new(0,25,0,25)
  842. GuiSlider2.Transparency = 0.3
  843. GuiSlider2.BackgroundColor = BrickColor.new("Black")
  844. GuiSlider2.TextColor = BrickColor.new("White")
  845. GuiSlider2.Position = UDim2.new(0.859,1,0.895,1)
  846. GuiSlider2.MouseButton1Down:connect(function()
  847. SizeX = SizeX + 1
  848. if SizeX > 3 then
  849. SizeX = 1
  850. end
  851. end)
  852. elseif GuiSlider1 ~= nil and GuiSlider2 ~= nil and Action ~= "Build" then
  853. GuiSlider1:Destroy()
  854. GuiSlider2:Destroy()
  855. end
  856.  
  857. if string.byte(key) == 48 then
  858. speed = 5
  859.  
  860.  
  861. elseif key == "s" then
  862. keyS = true
  863. repeat
  864. wait()
  865. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-speed))
  866. EyeWeld.C0 = CFrame.new(0,0,0.7)
  867. until keyS == false
  868.  
  869.  
  870. elseif key =="w" then
  871. keyW = true
  872. repeat
  873. wait()
  874. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,speed))
  875. EyeWeld.C0 = CFrame.new(0,0,0.7)
  876. until keyW == false
  877.  
  878.  
  879. elseif key =="a" then
  880. keyA = true
  881. repeat
  882. wait()
  883. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(speed,0,0))
  884. until keyA == false
  885.  
  886.  
  887. elseif key =="d" then
  888. keyD = true
  889. repeat
  890. wait()
  891. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-speed,0,0))
  892. until keyD == false
  893.  
  894.  
  895. elseif key == "e" then
  896. Camera.Transparency = math.abs(Camera.Transparency - 1)
  897. end
  898. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  899. end)
  900.  
  901.  
  902. function keyLiftedFunction(key)
  903. print(string.byte(key))
  904.  
  905. if key == "s" then keyS = false end
  906. if key == "a" then keyA = false end
  907. if key == "d" then keyD = false end
  908. if key == "w" then keyW = false end
  909. if string.byte(key) == 48 then speed = 0.7 end
  910. end
  911.  
  912. Mouse.KeyUp:connect(keyLiftedFunction)
  913.  
  914.  
  915.  
  916.  
  917.  
  918. wait(2)
  919. Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement