Advertisement
Aperture10

Untitled

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