Advertisement
Aperture10

Untitled

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