VoidScript

Clone trooper release :DDD

Jun 19th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.17 KB | None | 0 0
  1. --Edited by BiteMode
  2. --// Controls
  3. --// X = Summon a clone
  4. --// M = Change Types of clone (Snipers, riflers) Sniper is the default
  5. --// Q = Aim
  6. --// C = Makes all the clones disappear.
  7. --// Click = Shoot (You have to aim at somebody for snipers, you don't have to for the rifles)
  8.  
  9. plr = game:service'Players'.LocalPlayer
  10. char = plr.Character
  11.  
  12. --// Anti double
  13. script.Name = "BODYGUARDSV2_TEMP"
  14. for _, a in pairs(char:GetDescendants()) do
  15. if a.Name == "BODYGUARDSV2" then
  16. a:Destroy()
  17. elseif a.Name == "" then
  18. a:Destroy()
  19. end
  20. end
  21. script.Name = "BODYGUARDSV2"
  22. --// Main Script
  23.  
  24. head = char.Head
  25. mouse = plr:GetMouse()
  26. sam = 0
  27. char.Archivable = true
  28. arms = nil
  29. torso = nil
  30. follow = false
  31. current = nil
  32. curfollow = nil
  33. rifleshoot = false
  34. targ, huma = nil,nil
  35.  
  36. --// points
  37. point1 = Instance.new('Part', char)
  38. point1.Anchored = false
  39. point1.CanCollide = false
  40. point1.Transparency = 1
  41. point1.Size = Vector3.new(0.2,0.2,0.2)
  42.  
  43. Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
  44. Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
  45. Weld.Part1 = point1
  46. Weld.C1 = CFrame.new(10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  47.  
  48. point2 = Instance.new('Part', char)
  49. point2.Anchored = false
  50. point2.CanCollide = false
  51. point2.Transparency = 1
  52. point2.Size = Vector3.new(0.2,0.2,0.2)
  53.  
  54. Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
  55. Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
  56. Weld.Part1 = point2
  57. Weld.C1 = CFrame.new(-10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  58. --// points
  59.  
  60. --// Configuration
  61.  
  62. max = 100
  63. max1 = 2
  64. maxammo = 35
  65. mode = "Snipers"
  66.  
  67. --//
  68.  
  69. snipers,riflers,welds = {},{},{}
  70.  
  71. skinc = {
  72. 'Pastel yellow',
  73. 'Pastel yellow',
  74. 'Pastel yellow',
  75. 'Pastel yellow',
  76. 'Pastel yellow'
  77. }
  78.  
  79. props = {
  80. 'HeadColor',
  81. 'LeftArmColor',
  82. 'RightArmColor',
  83. 'TorsoColor',
  84. 'RightLegColor',
  85. 'LeftLegColor'
  86. }
  87.  
  88. snpr = char:Clone()
  89. snpr.Name = "Storm Trooper"
  90.  
  91. for _, a in pairs(snpr:children()) do
  92. if a:IsA'CharacterMesh' or a:IsA'Accessory' or a:IsA'Shirt' or a:IsA'Pants' then
  93. a:Destroy()
  94. end
  95. end
  96.  
  97. snpr.Parent = nil
  98.  
  99. bg = Instance.new("BodyGyro", snpr.HumanoidRootPart)
  100. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  101. bg.Name = "FOLLOW"
  102. bg.P = 10000
  103. bg.D = 100
  104.  
  105. sfx = Instance.new('Sound', snpr.Head)
  106. sfx.SoundId = "rbxassetid://740599871"
  107. sfx.Volume = 0.1
  108. sfx2 = Instance.new('Sound', snpr)
  109. sfx2.Name = "SNIPERSOUND"
  110. sfx2.SoundId = "rbxassetid://387095243"
  111. sfx2.Volume = 3
  112.  
  113. lazor = Instance.new('Part', snpr)
  114. lazor.Name = "Laser"
  115. lazor.Anchored = true
  116. lazor.Shape = Enum.PartType.Ball
  117. lazor.Size = Vector3.new(0.3,0.3,0.3)
  118. lazor.BrickColor = BrickColor.new('Crimson')
  119. lazor.Transparency = 0.5
  120. lazor.CanCollide = false
  121. lazor.Material = "Neon"
  122.  
  123. shirt = Instance.new('Shirt', snpr)
  124. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=381317974"
  125. pants = Instance.new('Pants', snpr)
  126. pants.PantsTemplate = "http://www.roblox.com/asset/?id=381318292"
  127. ----------------------------------------------------------------
  128. hat = Instance.new('Part', snpr)
  129. hat.Name = 'Hat'
  130. hat.Anchored = false
  131. hat.CanCollide = false
  132. mesh = Instance.new('SpecialMesh', hat)
  133. mesh.MeshId = "http://www.roblox.com/asset/?id=181587601"
  134. mesh.TextureId = "http://www.roblox.com/asset/?id=182191697"
  135. mesh.Scale = Vector3.new(1,1,1)
  136. weld = Instance.new('Weld', hat)
  137. weld.Part0 = hat
  138. weld.Part1 = snpr.Head
  139. weld.C0 = CFrame.new(0,-0.0,0)
  140. --------------------------------------------
  141. sniper = Instance.new('Part', snpr)
  142. sniper.Anchored = false
  143. sniper.CanCollide = false
  144. sniper.Name = "Sniper"
  145. sniper.Size = Vector3.new(7.88, 1.77, 1)
  146. mesh = Instance.new('SpecialMesh', sniper)
  147. mesh.MeshId = "rbxassetid://1049766998"
  148. mesh.TextureId = "rbxassetid://462309404"
  149. mesh.Scale = Vector3.new(0.008, 0.008, 0.008)
  150. weld = Instance.new('Weld', sniper)
  151. weld.Part0 = sniper
  152. weld.Part1 = snpr.Head
  153. weld.C0 = CFrame.new(-2,0.5,-0.2) * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))
  154.  
  155. arms = {snpr:FindFirstChild("Left Arm"), snpr:FindFirstChild("Right Arm")}
  156. torso = snpr:FindFirstChild("Torso")
  157.  
  158. if arms ~= nil and torso ~= nil then
  159. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  160. if sh ~= nil then
  161. local yes = true
  162. if yes then
  163. yes = false
  164. sh[1].Part1 = nil
  165. sh[2].Part1 = nil
  166. local weld1 = Instance.new("Weld")
  167. weld1.Part0 = torso
  168. weld1.Parent = torso
  169. weld1.Part1 = arms[1]
  170. weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  171. welds[1] = weld1
  172. local weld2 = Instance.new("Weld")
  173. weld2.Part0 = torso
  174. weld2.Parent = torso
  175. weld2.Part1 = arms[2]
  176. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  177. welds[2] = weld2
  178. end
  179. end
  180. end
  181.  
  182. function sniper(pos)
  183. if sam <= max - 1 then
  184. local sniper = snpr:Clone()
  185. local bodyc = sniper:FindFirstChildOfClass'BodyColors'
  186. local skincolor = skinc[math.random(1,5)]
  187.  
  188. for _, a in pairs(props) do
  189. bodyc[a] = BrickColor.new(skincolor)
  190. end
  191.  
  192. sniper.Parent = char
  193. sniper:MoveTo(pos)
  194. sniper.Torso.CFrame = CFrame.new(sniper.Torso.Position, head.Position)
  195. table.insert(snipers, sniper)
  196. sam = sam + 1
  197. end
  198. end
  199.  
  200. function rifler(pos)
  201. if sam <= max1 - 1 then
  202. local rifler = snpr:Clone()
  203. local bodyc = rifler:FindFirstChildOfClass'BodyColors'
  204. local skincolor = skinc[math.random(1,5)]
  205.  
  206. for _, a in pairs(props) do
  207. bodyc[a] = BrickColor.new(skincolor)
  208. end
  209.  
  210. rifler.Parent = char
  211. rifler:MoveTo(pos)
  212. rifler.Torso.CFrame = CFrame.new(rifler.Torso.Position, head.Position)
  213. rifler:FindFirstChild'SNIPERSOUND'.Pitch = 1
  214. rifle = rifler:FindFirstChild'Sniper'
  215. rifle.Name = "Rifle"
  216. rifle:FindFirstChildOfClass'SpecialMesh'.TextureId = "rbxassetid://546505949"
  217. rifle:FindFirstChildOfClass'SpecialMesh'.MeshId = "rbxassetid://546505802"
  218. rifle:FindFirstChildOfClass'SpecialMesh'.Scale = Vector3.new(0.2, 0.2, 0.2)
  219. rifle:FindFirstChildOfClass'Weld'.C0 = CFrame.new(-.4,.6,1.6) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  220. table.insert(riflers, rifler)
  221. sam = sam + 1
  222. end
  223. end
  224.  
  225. function ray(a,b)
  226. local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700)
  227. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  228.  
  229. local beam = Instance.new("Part", workspace)
  230. beam.FormFactor = "Custom"
  231. beam.Material = "Neon"
  232. beam.Transparency = 0.30
  233. beam.Anchored = true
  234. beam.Locked = true
  235. beam.CanCollide = false
  236. beam.BrickColor = BrickColor.new('Crimson')
  237.  
  238. local distance = (a.CFrame.p - position).magnitude
  239. beam.Size = Vector3.new(0.08, 0.08, distance)
  240. beam.CFrame = CFrame.new(a.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  241.  
  242. game:GetService('Debris'):AddItem(beam, 0.1)
  243. end
  244.  
  245. mouse.KeyDown:connect(function(k)
  246. local key = k:lower()
  247. if key == "x" then
  248. follow = false
  249. if mode == "Snipers" then
  250. sniper(mouse.Hit.p)
  251. elseif mode == "Riflers" then
  252. rifler(mouse.Hit.p)
  253. end
  254. wait(.3)
  255. if curfollow then
  256. follow = true
  257. elseif not curfollow then
  258. follow = false
  259. end
  260. elseif key == "c" then
  261. for _, a in pairs(char:children()) do
  262. if a.Name == "" then
  263. for i = 1,10 do
  264. a:FindFirstChild'HumanoidRootPart'.CFrame = a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0)
  265. wait()
  266. end
  267. wait(.15)
  268. a:Destroy()
  269. sam = sam - 1
  270. end
  271. end
  272. elseif key == "m" then
  273. if mode == "Snipers" then
  274. mode = "Riflers"
  275. elseif mode == "Riflers" then
  276. mode = "Snipers"
  277. end
  278. elseif key == "q" then
  279. if not follow then
  280. follow = true
  281. curfollow = true
  282. on = false
  283. for i = 1, sam / 2 do
  284. wait(.6)
  285. local now
  286. ypcall(function()
  287. if mode == "Snipers" then
  288. now = snipers[math.random(1,#snipers)]
  289. elseif mode == "Riflers" then
  290. now = riflers[math.random(1,#riflers)]
  291. end
  292. end)
  293. for _, a in pairs(riflers) do
  294. bg = Instance.new("BodyGyro", a.HumanoidRootPart)
  295. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  296. bg.Name = "FOLLOW"
  297. bg.P = 10000
  298. bg.D = 100
  299. end
  300. now.Head.Sound:Resume()
  301. current = now.Head.Sound.SoundId
  302. end
  303. elseif follow then
  304. for _, a in pairs(riflers) do
  305. for _, b in pairs(a:GetDescendants()) do
  306. if b:IsA'BodyGyro' then
  307. b:Destroy()
  308. end
  309. end
  310. end
  311. follow = false
  312. curfollow = false
  313. end
  314. end
  315. end)
  316.  
  317. mouse.Button1Down:connect(function()
  318. if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then
  319. follow = false
  320. local targ = mouse.Target
  321. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  322. for _, a in pairs(targ.Parent:children()) do
  323. if a:IsA'ForceField' then
  324. a:Destroy()
  325. end
  326. end
  327. huma.MaxHealth = 200
  328. huma.Name = "Humanoid"
  329. if mode == "Snipers" then
  330. for _, a in pairs(snipers) do
  331. if a:FindFirstChild'HumanoidRootPart' then
  332. wait(.2)
  333. rootpart = a.HumanoidRootPart
  334. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  335. snd:Play()
  336. ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position)
  337. huma:TakeDamage(huma.MaxHealth/2/2/2)
  338. end
  339. end
  340. follow = true
  341. end
  342. end
  343. end)
  344.  
  345. mouse.Button1Down:connect(function()
  346. if mode == "Riflers" then
  347. rifleshoot = true
  348. end
  349. end)
  350.  
  351. mouse.Button1Up:connect(function()
  352. if mode == "Riflers" then
  353. rifleshoot = false
  354. end
  355. end)
  356.  
  357. while wait() do
  358. ypcall(function()
  359. riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position)
  360. riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position)
  361. end)
  362. if follow then
  363. if mode == "Snipers" then
  364. for _, a in pairs(snipers) do
  365. if a:FindFirstChild'HumanoidRootPart' then
  366. rootpart = a.HumanoidRootPart
  367. rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0))
  368. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  369. end
  370. end
  371. elseif mode == "Riflers" then
  372. for _, a in pairs(riflers) do
  373. if a:FindFirstChild'HumanoidRootPart' then
  374. rootpart = a.HumanoidRootPart
  375. ypcall(function() rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0)) end)
  376. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  377. end
  378. end
  379. end
  380. end
  381. if rifleshoot and follow and mouse.Target and mouse.Target.Parent then
  382. local targ = mouse.Target
  383. local huma = nil
  384. if targ.Parent:FindFirstChildOfClass'Humanoid' then
  385. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  386. else
  387. huma = nil
  388. end
  389. if huma ~= nil then
  390. for _, a in pairs(riflers) do
  391. if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0 then
  392. wait(.02)
  393. rootpart = a.HumanoidRootPart
  394. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  395. snd.Pitch = 1
  396. snd:Resume()
  397. ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position)
  398. huma:TakeDamage(huma.MaxHealth/2/2/2/2/2)
  399. end
  400. end
  401. else
  402. for _, a in pairs(riflers) do
  403. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  404. snd.Pitch = 1
  405. snd:Resume()
  406. ray(a:FindFirstChild'Rifle',mouse.Hit.p)
  407. end
  408. end
  409. end
  410. end
Add Comment
Please, Sign In to add comment