Advertisement
Aperture10

Untitled

May 2nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.15 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. end)
  497. elseif i == 2 then
  498. gui.Text = "Remove All"
  499. gui.MouseButton1Click:connect(function()
  500. for ii,vv in pairs (object:GetChildren()) do
  501. if vv.Name == v.Name then
  502. vv:Destroy()
  503. end
  504. end
  505. end)
  506. end
  507. end
  508. end)
  509.  
  510. --gui.MouseButton2Click:connect(function()
  511. --v:Destroy()
  512. --generateChildrenGui(clickedExplorerObjectSelection, guiPosX, guiPosY)
  513. --end)
  514. end
  515. explorerRowSize = 0
  516. explorerRowWidth = 1
  517.  
  518. print(object.Name)
  519.  
  520. if updateExplorerAdded ~= nil and updateExplorerRemoved ~= nil then ---Will update everytime the 'object' changes
  521. updateExplorerAdded:Disconnect()
  522. updateExplorerRemoved:Disconnect()
  523. end
  524.  
  525. updateExplorerAdded = object.ChildAdded:connect(function() ---Should update the GUI when anything changes?
  526. generateChildrenGui(object, guiPosX, guiPosY)
  527. end)
  528.  
  529. updateExplorerRemoved = object.ChildRemoved:connect(function() ---Should update the GUI when anything changes?
  530. generateChildrenGui(object, guiPosX, guiPosY)
  531. end)
  532.  
  533. end
  534.  
  535. explorerMouseClicking1 = Mouse.Button1Down:connect(function()
  536. if Mouse.Target ~= nil and exploring == true then
  537. print('exploring mouse clicked')
  538. generateChildrenGui(getMasterModel(Mouse.Target), guiExplore.Position.X.Offset, guiExplore.Position.Y.Offset)
  539. elseif exploring == false then
  540. print('exploring mouse disconnected')
  541. explorerMouseClicking1:Disconnect()
  542. end
  543. end)
  544.  
  545. exploringMouseClicking2 = Mouse.Button2Down:connect(function()
  546. if exploring == true then
  547. for i = 1, 2 do
  548.  
  549. end
  550. elseif exploring == false then
  551. exploringMouseClicking2:Disconnect()
  552. end
  553. end)
  554.  
  555.  
  556.  
  557. guiExplore.MouseButton1Click:connect(function()
  558. if exploring == false then
  559. generateChildrenGui(game, guiExplore.Position.X.Offset, guiExplore.Position.Y.Offset)
  560. exploring = true
  561. exploringCanClose = false
  562.  
  563.  
  564.  
  565. elseif exploring == true and exploringCanClose == false then
  566. generateChildrenGui(clickedExplorerObjectSelection.Parent, guiExplore.Position.X.Offset, guiExplore.Position.Y.Offset)
  567. clickedExplorerObjectSelection = clickedExplorerObjectSelection.Parent
  568. if clickedExplorerObjectSelection == game then
  569. exploringCanClose = true
  570. guiExplore.Text = "Close"
  571. guiExplore.BackgroundColor = BrickColor.new("Really red")
  572. end
  573.  
  574.  
  575.  
  576. elseif exploring == true and exploringCanClose == true then
  577. explorerFolder:ClearAllChildren()
  578. guiExplore.Text = "Explorer"
  579. guiExplore.BackgroundColor = BrickColor.new("Bright green")
  580. end
  581. end)
  582.  
  583.  
  584.  
  585. end)
  586.  
  587. end)
  588.  
  589. end
  590.  
  591. freshLoad()
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603. local GhostPart = Instance.new("Part")
  604. GhostPart.CanCollide = false
  605. GhostPart.Anchored = true
  606. GhostPart.Transparency = 0.5
  607. GhostPart.Size = Vector3.new(SizeX,SizeY,SizeZ)
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615. --workspace.CurrentCamera.CameraType = "Scriptable"
  616.  
  617.  
  618. function getMasterModel(target)
  619. repeat
  620. wait()
  621.  
  622. if Char:IsAncestorOf(target) or target == nil then
  623. return nil
  624. end
  625.  
  626.  
  627.  
  628. if target.Parent ~= workspace then
  629. target = target.Parent
  630. else
  631. if target.Name == "Base" then return nil end --We don't want to mess with the baseplate
  632. return target
  633. end
  634. until target == false
  635. end
  636.  
  637.  
  638.  
  639. -------------------------------------------------------------------------------MAIN FUNCTIONS MARK-------------------------------------
  640.  
  641.  
  642.  
  643.  
  644. function DestroyFunction()
  645. SB.Adornee:Destroy()
  646. end
  647.  
  648. function KillFunction()
  649. for i,v in pairs(SB.Adornee:GetDescendants()) do
  650. if v:IsA("Humanoid") then
  651. v.Health = 0
  652. v:Destroy()
  653. end
  654. end
  655. end
  656.  
  657. function BreakJointsFunction()
  658. SB.Adornee:BreakJoints()
  659.  
  660. end
  661.  
  662. function DistortFunction()
  663. --if Mode == "Model" then
  664. print(SB.Adornee.ClassName)
  665. for _,v in pairs(SB.Adornee:GetDescendants()) do
  666. if v:IsA("Part","WedgePart","UnionOperation") then
  667. 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))
  668. end
  669. end
  670. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  671. SB.Adornee.Size = Vector3.new(math.random(SB.Adornee.Size.X),math.random(SB.Adornee.Size.Y),math.random(SB.Adornee.Size.Z)) +
  672. Vector3.new(math.random(SB.Adornee.Size.X),math.random(SB.Adornee.Size.Y),math.random(SB.Adornee.Size.Z))
  673. end
  674. end
  675.  
  676. function rektFunction()
  677. for _,v in pairs(SB.Adornee:GetDescendants()) do
  678. if v:IsA("Part","WedgePart","UnionOperation") then
  679. v:breakJoints()
  680. v.Anchored = false
  681. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  682. v.Color = Color3.new(math.random(),math.random(),math.random())
  683. end
  684. end
  685. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  686. local v = SB.Adornee
  687. v:breakJoints()
  688. v.Anchored = false
  689. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  690. v.Color = Color3.new(math.random(),math.random(),math.random())
  691. end
  692. end
  693.  
  694. function AnchorFunction()
  695. for _,v in pairs (SB.Adornee:GetDescendants()) do
  696. if v:IsA("Part","WedgePart","UnionOperation") then
  697. v.Anchored = not v.Anchored
  698. end
  699. end
  700. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  701. SB.Adornee.Anchored = not SB.Adornee.Anchored
  702. end
  703. end
  704.  
  705. function PushFunction()
  706. for _,v in pairs (SB.Adornee:GetDescendants()) do
  707. if v:IsA("Part","WedgePart","UnionOperation") then
  708. v.Anchored = false
  709. v.Velocity = Mouse.Target.CFrame.lookVector * 1000
  710. end
  711. end
  712. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  713. SB.Adornee.Anchored = false
  714. SB.Adornee.Velocity = Mouse.Target.CFrame.lookVector * 1000
  715. end
  716. end
  717.  
  718. function FreezeFunction()
  719. for _,v in pairs(SB.Adornee:GetDescendants()) do
  720. if v:IsA("Part","WedgePart","UnionOperation") then
  721. v.BrickColor = BrickColor.new("Pastel Blue")
  722. v.Anchored = true
  723. v.Material = "Ice"
  724. end
  725. end
  726. if SB.Adornee:IsA("Part","WedgePart","UnionOperation") then
  727. SB.Adornee.Anchored = true
  728. SB.Adornee.Material = "Ice"
  729. end
  730. end
  731.  
  732. function CloneFunction()
  733. SB.Adornee.Archivable = true
  734. local c = SB.Adornee:Clone()
  735. c.Parent = workspace
  736. c:MakeJoints()
  737.  
  738. if c.ClassName == "Model" then
  739. c:MoveTo(Mouse.Target.CFrame.p + Vector3.new(0,5,0))
  740. elseif c:IsA("Part","WedgePart","UnionOperation") then
  741. c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
  742. end
  743.  
  744.  
  745. spawn(function()
  746.  
  747. if c:findFirstChild("Humanoid") and c:findFirstChild("Torso") then
  748. local human = c.Humanoid
  749. local torso = c.Torso
  750.  
  751. human.Archivable = true
  752.  
  753. local bp = Instance.new("BodyPosition",torso)
  754. bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  755. bp.Position = torso.Position
  756.  
  757. if c:findFirstChild("Right Arm") and c:findFirstChild("Left Arm") then ---Put the arms up like a zombie
  758. local zarm1 = c["Right Arm"]
  759. local zarm2 = c["Left Arm"]
  760.  
  761. local weld = Instance.new("Weld",c)
  762. weld.Part0 = torso
  763. weld.Part1 = zarm2
  764. weld.C0 = CFrame.new(-1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) --Left arm
  765.  
  766. local weld = Instance.new("Weld",c)
  767. weld.Part0 = torso
  768. weld.Part1 = zarm1
  769. weld.C0 = CFrame.new(1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) --Right arm
  770.  
  771. local function touchChaos(hit)
  772.  
  773. if c == nil then return end
  774. if hit.Name == c.Name then return end
  775. if getMasterModel(hit) == nil or hit.Parent == nil or hit == nil then return end
  776. if getMasterModel(hit).Name == c.Name then return end
  777. if hit.Parent == c then return end
  778.  
  779.  
  780. if hit.Parent:findFirstChild("Torso") then
  781. if hit.Parent.Torso:findFirstChild("BodyPosition") then
  782. return ----Don't hurt other clones
  783. end
  784. end
  785.  
  786. print('touched '..hit.Name..'parent of '..hit.Parent.Name..'I AM: '..c.Name)
  787.  
  788. if hit.Parent:findFirstChild("Humanoid") then
  789. hit.Parent.Humanoid:Destroy()
  790. elseif hit.Parent ~= workspace and hit.BrickColor ~= BrickColor.new("Really red") then
  791. for i,v in pairs(getMasterModel(hit):GetDescendants()) do
  792. if v:IsA("Part") or v:IsA("WedgePart") then
  793. v:breakJoints()
  794. v.Anchored = false
  795. v.Velocity = Vector3.new(math.random(-250,250),math.random(-250,250),math.random(-250,250))
  796. v.BrickColor = BrickColor.new("Really red")
  797. end
  798. end
  799. game:GetService("Debris"):AddItem(getMasterModel(hit), 5)
  800. elseif hit:IsA("Part") and hit.Name ~= "Base" then
  801. hit:Destroy()
  802. end
  803. end
  804.  
  805. zarm1.Touched:connect(touchChaos)
  806. zarm2.Touched:connect(touchChaos)
  807. end
  808.  
  809. repeat
  810.  
  811. local targets = {}
  812.  
  813. local players = workspace:GetChildren()
  814.  
  815.  
  816.  
  817. local enemyTorso = nil
  818. local enemyHuman = nil
  819. local enemyTorsoDistance = nil
  820.  
  821. for i,v in pairs(players) do
  822.  
  823.  
  824. if v:findFirstChild("Humanoid") and v:findFirstChild("Torso") and v ~= c and v.Name ~= c.Name then
  825.  
  826.  
  827. if (v.Torso.Position - torso.Position).magnitude < 200 and v.Humanoid.Health > 0 and
  828. v.Torso:findFirstChild("BodyPosition") == nil then
  829.  
  830. enemyTorsoDistance = (v.Torso.Position - torso.Position).magnitude
  831. enemyTorso = v.Torso
  832. enemyHuman = v.Humanoid
  833.  
  834. table.insert(targets, enemyTorso)
  835.  
  836.  
  837. end
  838. end
  839. end
  840.  
  841. if #targets > 0 then
  842. local target = targets[math.random(#targets)]
  843. print("Target: "..target.Parent.Name.."I am: "..c.Name)
  844. human:MoveTo(target.Position, target)
  845. human.WalkSpeed = 20
  846. human.Jump = true
  847. bp.Position = target.Position
  848. end
  849.  
  850.  
  851. wait(2)
  852.  
  853.  
  854.  
  855. until human == nil or human.Health < 1 or torso == nil or human.Parent.Parent == nil
  856. print(c.Name.." has died!")
  857. game:GetService("Debris"):AddItem(c, 0.1)
  858. end
  859. end)
  860. end
  861.  
  862. function WeldFunction()
  863. local welds = {}
  864. for _,v in pairs(SB.Adornee:GetDescendants()) do
  865. if v:IsA("Part","WedgePart","UnionOperation") then
  866. table.insert(welds, v)
  867. local weld = Instance.new("Weld")
  868. weld.Parent = workspace
  869. weld.Part0 = welds[math.random(#welds)]
  870. weld.Part1 = v
  871. weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  872. end
  873. end
  874. end
  875.  
  876.  
  877. function BuildFunction()
  878. local p = Instance.new("Part",workspace)
  879. p.CFrame = GhostPart.CFrame
  880. p:MakeJoints()
  881. p.Anchored = true
  882. p.Size = Vector3.new(SizeX,SizeY,SizeZ)
  883. end
  884.  
  885. function LaserFunction()
  886. if SB.Adornee:findFirstChild("Humanoid") then
  887. SB.Adornee.Humanoid:TakeDamage(25)
  888. end
  889. local Laser = Instance.new("Part",workspace)
  890. Laser.Anchored = true
  891. Laser.BrickColor = BrickColor.new("Really red")
  892. Laser.TopSurface = "Smooth"
  893. Laser.BottomSurface = "Smooth"
  894. Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
  895. Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
  896. game:GetService("Debris"):AddItem(Laser,1)
  897. spawn(function()
  898. repeat
  899. wait()
  900. Laser.Transparency = Laser.Transparency + 0.05
  901. Laser.Size = Laser.Size - Vector3.new(0.05,0,0.05)
  902. until Laser.Transparency > 1
  903. end)
  904. end
  905.  
  906. function ActionFunction()
  907. if Action == "Destroy" then
  908. DestroyFunction()
  909. elseif Action == "Kill" then
  910. KillFunction()
  911. elseif Action == "BreakJoints" then
  912. BreakJointsFunction()
  913. elseif Action == "Distort" then
  914. DistortFunction()
  915. elseif Action == "Anchor" then
  916. AnchorFunction()
  917. elseif Action == "Push" then
  918. PushFunction()
  919. elseif Action == "Freeze" then
  920. FreezeFunction()
  921. elseif Action == "Clone" then
  922. CloneFunction()
  923. elseif Action == "Build" then
  924. BuildFunction()
  925. elseif Action == "Laser" then
  926. LaserFunction()
  927. elseif Action == "Rekt" then
  928. rektFunction()
  929. elseif Action == "Weld" then
  930. WeldFunction()
  931. end
  932. end
  933.  
  934.  
  935.  
  936. local mouseTarget = nil
  937.  
  938. Mouse.Move:connect(function()
  939.  
  940.  
  941.  
  942.  
  943. Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
  944.  
  945. if Mouse.Target ~= nil then
  946.  
  947. if mouseTarget == Mouse.Target then --Don't waste resources when we already have what we want.
  948. return
  949. end
  950.  
  951.  
  952.  
  953. if Mode == "Part" then
  954. mouseTarget = Mouse.Target
  955. SB.Adornee = Mouse.Target
  956. elseif Mode == "Model" then
  957. mouseTarget = Mouse.Target
  958. SB.Adornee = getMasterModel(Mouse.Target)--Mouse.Target.Parent
  959. end
  960.  
  961. if Action == "Build" then
  962. GhostPart.Parent = Char
  963. if Mouse.Target ~= GhostPart then
  964. GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
  965. end
  966. elseif Action ~= "Build" then
  967. GhostPart.Parent = nil
  968. end
  969.  
  970. else
  971. SB.Adornee = nil
  972. end
  973. end)
  974.  
  975. Mouse.Button1Down:connect(function()
  976.  
  977.  
  978. if Player.Character:findFirstChild("Eye") == nil then print('freshload due to Eye missing') freshLoad() end
  979.  
  980.  
  981. if workspace:findFirstChild(Player.Name) == nil then print('freshload due to Character missing') freshLoad() end
  982.  
  983.  
  984. if SB.Adornee ~= nil and menuUp == false then ---Won't run ActionsFunctions when a program is being used.
  985. ActionFunction()
  986. end
  987. end)
  988.  
  989. local keyS = false
  990. local keyW = false
  991. local keyA = false
  992. local keyD = false
  993.  
  994. local speed = 0.7 -- fast is 5
  995.  
  996. GuiSlider2 = nil
  997. GuiSlider1 = nil
  998.  
  999. Mouse.KeyDown:connect(function(key)
  1000. if key == "c" then
  1001. Mode = "Part"
  1002. elseif key == "v" then
  1003. Mode = "Model"
  1004. elseif key == "z" then
  1005. Selection = Selection + 1
  1006. if Selection > #Actions then
  1007. Selection = 1
  1008. end
  1009. Action = Actions[Selection]
  1010. elseif key == "x" then
  1011. Selection = Selection - 1
  1012. if Selection < 1 then
  1013. Selection = #Actions
  1014. end
  1015. Action = Actions[Selection]
  1016. end
  1017.  
  1018. if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
  1019. GuiSlider1 = Instance.new("TextButton",ScreenGui)
  1020. GuiSlider1.Text = "<"
  1021. GuiSlider1.Size = UDim2.new(0,25,0,25)
  1022. GuiSlider1.Transparency = 0.3
  1023. GuiSlider1.BackgroundColor = BrickColor.new("Black")
  1024. GuiSlider1.TextColor = BrickColor.new("White")
  1025. GuiSlider1.Position = UDim2.new(0.7,1,0.895,1)
  1026. GuiSlider1.MouseButton1Down:connect(function()
  1027. SizeX = SizeX - 1
  1028. if SizeX < 1 then
  1029. SizeX = 3
  1030. end
  1031. end)
  1032.  
  1033. GuiSlider2 = Instance.new("TextButton",ScreenGui)
  1034. GuiSlider2.Text = ">"
  1035. GuiSlider2.Size = UDim2.new(0,25,0,25)
  1036. GuiSlider2.Transparency = 0.3
  1037. GuiSlider2.BackgroundColor = BrickColor.new("Black")
  1038. GuiSlider2.TextColor = BrickColor.new("White")
  1039. GuiSlider2.Position = UDim2.new(0.859,1,0.895,1)
  1040. GuiSlider2.MouseButton1Down:connect(function()
  1041. SizeX = SizeX + 1
  1042. if SizeX > 3 then
  1043. SizeX = 1
  1044. end
  1045. end)
  1046. elseif GuiSlider1 ~= nil and GuiSlider2 ~= nil and Action ~= "Build" then
  1047. GuiSlider1:Destroy()
  1048. GuiSlider2:Destroy()
  1049. end
  1050.  
  1051. if string.byte(key) == 48 then
  1052. speed = 5
  1053.  
  1054.  
  1055. elseif key == "s" then
  1056. keyS = true
  1057. repeat
  1058. wait()
  1059. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-speed))
  1060. EyeWeld.C0 = CFrame.new(0,0,0.7)
  1061. until keyS == false
  1062.  
  1063.  
  1064. elseif key =="w" then
  1065. keyW = true
  1066. repeat
  1067. wait()
  1068. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,speed))
  1069. EyeWeld.C0 = CFrame.new(0,0,0.7)
  1070. until keyW == false
  1071.  
  1072.  
  1073. elseif key =="a" then
  1074. keyA = true
  1075. repeat
  1076. wait()
  1077. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(speed,0,0))
  1078. until keyA == false
  1079.  
  1080.  
  1081. elseif key =="d" then
  1082. keyD = true
  1083. repeat
  1084. wait()
  1085. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-speed,0,0))
  1086. until keyD == false
  1087.  
  1088.  
  1089. elseif key == "e" then
  1090. Camera.Transparency = math.abs(Camera.Transparency - 1)
  1091. end
  1092. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  1093. end)
  1094.  
  1095.  
  1096. function keyLiftedFunction(key)
  1097. print(string.byte(key))
  1098.  
  1099. if key == "s" then keyS = false end
  1100. if key == "a" then keyA = false end
  1101. if key == "d" then keyD = false end
  1102. if key == "w" then keyW = false end
  1103. if string.byte(key) == 48 then speed = 0.7 end
  1104. end
  1105.  
  1106. Mouse.KeyUp:connect(keyLiftedFunction)
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112. wait(2)
  1113. Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement