Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.12 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. local Player = game.Players.LocalPlayer
  3. local Char = Player.Character
  4.  
  5. local Mouse = Player:GetMouse()
  6.  
  7. local RealCamera = workspace.CurrentCamera
  8.  
  9. local ScreenGui = Instance.new("ScreenGui",Player.PlayerGui)
  10.  
  11. local Actions = {"Destroy","Kill","BreakJoints","Distort","Anchor","Push","Freeze",
  12. "Clone","Build","Laser","Rekt","Weld"}
  13. local Action = "Destroy"
  14. local Selection = 1
  15. local Mode = "Model"--{"Part","Model"}
  16.  
  17. local GuiM = Instance.new("TextButton",ScreenGui)
  18. GuiM.Size = UDim2.new(0,150,0,25)
  19. GuiM.Position = UDim2.new(0.7,1,0.95,1)
  20. GuiM.Text = "Action: Destroy, Model"
  21. GuiM.BackgroundColor = BrickColor.new("Really black")
  22. GuiM.Transparency = 0.3
  23. GuiM.TextColor = BrickColor.new("White")
  24.  
  25. local SB = Instance.new("SelectionBox",workspace.CurrentCamera)
  26.  
  27. wait(1)
  28.  
  29. for _,v in pairs(Char:GetChildren()) do
  30. if v:IsA("Part") or v:IsA("Humanoid") or v:IsA("Hat") then
  31. v:Destroy()
  32. end
  33. end
  34.  
  35.  
  36. local Camera = Instance.new("Part",Char) -- New character
  37. Camera.Size = Vector3.new(1.5,1.5,1.5)
  38. Camera.Shape = "Ball"
  39. Camera.BrickColor = BrickColor.new("Really black")
  40. Camera.CanCollide = false
  41. Camera.TopSurface = "Smooth"
  42. Camera.BottomSurface = "Smooth"
  43. Camera.Anchored = true
  44. Camera.Locked = true
  45. Camera.CFrame = CFrame.new(0,10,0)
  46. Camera.BackSurface = "Motor"
  47.  
  48. local Eye = Instance.new("Part",Char)
  49. Eye.Size = Vector3.new(0.4,0.4,0.4)
  50. Eye.Shape = "Ball"
  51. Eye.BrickColor = BrickColor.new("White")
  52. Eye.CanCollide = false
  53. Eye.TopSurface = "Smooth"
  54. Eye.BottomSurface = "Smooth"
  55. Eye.Locked = true
  56. Eye:BreakJoints()
  57.  
  58. local EyeWeld = Instance.new("Weld")
  59. EyeWeld.Parent = Char
  60. EyeWeld.Part0 = Eye
  61. EyeWeld.Part1 = Camera
  62. EyeWeld.C0 = CFrame.new(0,0,0.7)
  63.  
  64. --workspace.CurrentCamera.CameraType = "Scriptable"
  65. workspace.CurrentCamera.CameraSubject = Camera
  66.  
  67. function DestroyFunction()
  68. if Mode == "Model" then
  69. Mouse.Target.Parent:Destroy()
  70. elseif Mode == "Part" then
  71. Mouse.Target:Destroy()
  72. end
  73. end
  74.  
  75. function KillFunction()
  76. if Mouse.Target.Parent:findFirstChild("Humanoid") then
  77. Mouse.Target.Parent.Humanoid.Health = 0
  78. end
  79. end
  80.  
  81. function BreakJointsFunction()
  82. if Mode == "Model" then
  83. Mouse.Target.Parent:BreakJoints()
  84. elseif Mode == "Part" then
  85. Mouse.Target:BreakJoints()
  86. end
  87. end
  88.  
  89. function DistortFunction()
  90. if Mode == "Model" then
  91. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  92. if v:IsA("Part") then
  93. if v.Size.X > 1 and v.Size.Y > 1 and v.Size.Z > 1 then
  94. 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))
  95. v.Color = Color3.new(math.random(),math.random(),math.random())
  96. end
  97. end
  98. end
  99. elseif Mode == "Part" then
  100. local v = Mouse.Target
  101. 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))
  102. v.Color = Color3.new(math.random(),math.random(),math.random())
  103. end
  104. end
  105.  
  106. function rektFunction()
  107. if Mode == "Model" then
  108. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  109. if v:IsA("Part") then
  110. v:breakJoints()
  111. v.Anchored = false
  112. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  113. v.Color = Color3.new(math.random(),math.random(),math.random())
  114. end
  115. end
  116. elseif Mode == "Part" then
  117. local v = Mouse.Target
  118. v:breakJoints()
  119. v.Anchored = false
  120. v.Velocity = Vector3.new(math.random(-1000,1000),math.random(-1000,1000),math.random(-1000,1000))
  121. v.Color = Color3.new(math.random(),math.random(),math.random())
  122. end
  123. end
  124.  
  125. function AnchorFunction()
  126. if Mode == "Model" then
  127. for _,v in pairs (Mouse.Target.Parent:getChildren()) do
  128. if v:IsA("Part") then
  129. v.Anchored = not v.Anchored
  130. end
  131. end
  132. elseif Mode == "Part" then
  133. Mouse.Target.Anchored = not Mouse.Target.Anchored
  134. end
  135. end
  136.  
  137. function PushFunction()
  138. if Mode == "Model" then
  139. for _,v in pairs (Mouse.Target.Parent:getChildren()) do
  140. if v:IsA("Part") then
  141. v.Anchored = not v.Anchored
  142. v.Velocity = Mouse.Target.CFrame.lookVector * 1000
  143. end
  144. end
  145. elseif Mode == "Part" then
  146. Mouse.Target.Anchored = not Mouse.Target.Anchored
  147. Mouse.Target.Velocity = Mouse.Target.CFrame.lookVector * 1000
  148. end
  149. end
  150.  
  151. function FreezeFunction()
  152. if Mode == "Model" then
  153. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  154. if v:IsA("Part") then
  155. v.Anchored = true
  156. v.Material = "Ice"
  157. end
  158. end
  159. elseif Mode == "Part" then
  160. Mouse.Target.Anchored = true
  161. Mouse.Material = "Ice"
  162. end
  163. end
  164.  
  165. function CloneFunction()
  166. if Mode == "Model" then
  167. Mouse.Target.Parent.Archivable = true
  168. local c = Mouse.Target.Parent:Clone()
  169. c.Parent = workspace
  170. c:MoveTo(Mouse.Target.CFrame.p + Vector3.new(0,5,0))
  171. elseif Mode == "Part" then
  172. Mouse.Target.Archivable = true
  173. local c = Mouse.Target:Clone()
  174. c.Parent = workspace
  175. c.CFrame = Mouse.Target.CFrame + Vector3.new(0,5,0)
  176. end
  177. end
  178.  
  179. function WeldFunction()
  180. if Mode == "Model" then
  181. local welds = {}
  182. for _,v in pairs(Mouse.Target.Parent:GetChildren()) do
  183. if v:IsA("Part") then
  184. table.insert(welds, v)
  185. local weld = Instance.new("Weld")
  186. weld.Parent = workspace
  187. weld.Part0 = welds[math.random(#welds)]
  188. weld.Part1 = v
  189. weld.C1 = CFrame.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  190. end
  191. end
  192. end
  193. end
  194.  
  195. local SizeX = 3
  196. local SizeY = 3
  197. local SizeZ = 3
  198. function BuildFunction()
  199. local p = Instance.new("Part",workspace)
  200. p.CFrame = CFrame.new(Mouse.Hit.p)
  201. p:MakeJoints()
  202. p.Anchored = true
  203. p.Size = Vector3.new(SizeX,SizeY,SizeZ)
  204. end
  205.  
  206. function LaserFunction()
  207. if Mouse.Target.Parent:findFirstChild("Humanoid") then
  208. Mouse.Target.Parent.Humanoid.Health = Mouse.Target.Parent.Humanoid.Health - 25
  209. end
  210. local Laser = Instance.new("Part",workspace)
  211. Laser.Anchored = true
  212. Laser.BrickColor = BrickColor.new("Really red")
  213. Laser.TopSurface = "Smooth"
  214. Laser.BottomSurface = "Smooth"
  215. Laser.Size = Vector3.new(0.4,0.4,(Mouse.Hit.p - Camera.CFrame.p).magnitude)
  216. Laser.CFrame = CFrame.new(Camera.CFrame.p, Mouse.Hit.p):toWorldSpace(CFrame.new(0,0,-(Camera.CFrame.p- Mouse.Hit.p).magnitude/2))
  217. game:GetService("Debris"):AddItem(Laser,0.5)
  218. end
  219.  
  220. function ActionFunction()
  221. if Action == "Destroy" then
  222. DestroyFunction()
  223. elseif Action == "Kill" then
  224. KillFunction()
  225. elseif Action == "BreakJoints" then
  226. BreakJointsFunction()
  227. elseif Action == "Distort" then
  228. DistortFunction()
  229. elseif Action == "Anchor" then
  230. AnchorFunction()
  231. elseif Action == "Push" then
  232. PushFunction()
  233. elseif Action == "Freeze" then
  234. FreezeFunction()
  235. elseif Action == "Clone" then
  236. CloneFunction()
  237. elseif Action == "Build" then
  238. BuildFunction()
  239. elseif Action == "Laser" then
  240. LaserFunction()
  241. elseif Action == "Rekt" then
  242. rektFunction()
  243. elseif Action == "Weld" then
  244. WeldFunction()
  245. end
  246. end
  247.  
  248. local GhostPart = Instance.new("Part")
  249. GhostPart.CanCollide = false
  250. GhostPart.Anchored = true
  251. GhostPart.Transparency = 0.5
  252. GhostPart.Size = Vector3.new(3,3,3)
  253. Mouse.Move:connect(function()
  254. Camera.CFrame = CFrame.new(Camera.CFrame.p, RealCamera.CFrame.p)
  255.  
  256. if Mouse.Target ~= nil then
  257. if Mode == "Part" then
  258. SB.Adornee = Mouse.Target
  259. elseif Mode == "Model" then
  260. SB.Adornee = Mouse.Target.Parent
  261. end
  262.  
  263. if Action == "Build" then
  264. GhostPart.Parent = Char
  265. if Mouse.Target ~= GhostPart then
  266. GhostPart.CFrame = CFrame.new(Mouse.Hit.p)
  267. end
  268. elseif Action ~= "Build" then
  269. GhostPart.Parent = nil
  270. end
  271. end
  272. end)
  273.  
  274. Mouse.Button1Down:connect(function()
  275. if Mouse.Target ~= nil then
  276. ActionFunction()
  277. end
  278. end)
  279.  
  280. Mouse.KeyDown:connect(function(key)
  281. if key == "c" then
  282. Mode = "Part"
  283. elseif key == "v" then
  284. Mode = "Model"
  285. elseif key == "z" then
  286. Selection = Selection + 1
  287. if Selection > #Actions then
  288. Selection = 1
  289. end
  290. Action = Actions[Selection]
  291. elseif key == "x" then
  292. Selection = Selection - 1
  293. if Selection < 1 then
  294. Selection = #Actions
  295. end
  296. Action = Actions[Selection]
  297. end
  298. if Action == "Build" and key == "x" or key == "z" and Action == "Build" then
  299. local GuiSlider = Instance.new("TextButton",ScreenGui)
  300. GuiSlider.Text = "<"
  301. GuiSlider.Size = UDim2.new(0,25,0,25)
  302. GuiSlider.Transparency = 0.3
  303. GuiSlider.BackgroundColor = BrickColor.new("Black")
  304. GuiSlider.TextColor = BrickColor.new("White")
  305. GuiSlider.Position = UDim2.new(0.7,1,0.895,1)
  306. GuiSlider.MouseButton1Down:connect(function()
  307. SizeX = SizeX - 1
  308. if SizeX < 1 then
  309. SizeX = 3
  310. end
  311. end)
  312.  
  313. local GuiSlider = Instance.new("TextButton",ScreenGui)
  314. GuiSlider.Text = ">"
  315. GuiSlider.Size = UDim2.new(0,25,0,25)
  316. GuiSlider.Transparency = 0.3
  317. GuiSlider.BackgroundColor = BrickColor.new("Black")
  318. GuiSlider.TextColor = BrickColor.new("White")
  319. GuiSlider.Position = UDim2.new(0.859,1,0.895,1)
  320. GuiSlider.MouseButton1Down:connect(function()
  321. SizeX = SizeX + 1
  322. if SizeX > 3 then
  323. SizeX = 1
  324. end
  325. end)
  326. elseif key == "s" then
  327. keyLifted = nil
  328. repeat
  329. wait()
  330. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,-1))
  331. EyeWeld.C0 = CFrame.new(0,0,0.7)
  332. until keyLifted == "s"
  333. elseif key =="w" then
  334. keyLifted = nil
  335. repeat
  336. wait()
  337. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(0,0,1))
  338. EyeWeld.C0 = CFrame.new(0,0,0.7)
  339. until keyLifted == "w"
  340. elseif key =="a" then
  341. keyLifted = nil
  342. repeat
  343. wait()
  344. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(1,0,0))
  345. until keyLifted == "a"
  346. elseif key =="d" then
  347. keyLifted = nil
  348. repeat
  349. wait()
  350. Camera.CFrame = Camera.CFrame:toWorldSpace(CFrame.new(-1,0,0))
  351. until keyLifted == "d"
  352. elseif key == "e" then
  353. Camera.Transparency = math.abs(Camera.Transparency - 1)
  354. end
  355. GuiM.Text = "Action: "..Action..", Mode: "..Mode
  356. end)
  357.  
  358.  
  359. function keyLiftedFunction(key)
  360. print(key)
  361. keyLifted = key
  362. end
  363.  
  364. Mouse.KeyUp:connect(keyLiftedFunction)
  365.  
  366.  
  367.  
  368.  
  369.  
  370. wait(2)
  371. Player.Backpack:ClearAllChildren()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement