Advertisement
Aperture10

Untitled

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