Advertisement
VoidScript

Clone tropper

Jun 19th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.27 KB | None | 0 0
  1. --Edited by BiteMode
  2. --// Controls
  3. --// X = Summon a bodyguard
  4. --// M = Change Types of bodyguards (Snipers, riflers) Sniper is the default
  5. --// Q = Aim
  6. --// C = Makes all the bodyguards 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 = 50
  63. max1 = 10
  64. maxammo = 50
  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 = ""
  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 = 3
  108. sfx2 = Instance.new('Sound', snpr)
  109. sfx2.Name = "SNIPERSOUND"
  110. sfx2.SoundId = "rbxassetid://136523485"
  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('Bright blue')
  119. lazor.Transparency = 0.4
  120. lazor.CanCollide = false
  121.  
  122. shirt = Instance.new('Shirt', snpr)
  123. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=1161784003"
  124. pants = Instance.new('Pants', snpr)
  125. pants.PantsTemplate = "http://www.roblox.com/asset/?id=1161784003"
  126. ----------------------------------------------------------------
  127. hat = Instance.new('Part', snpr)
  128. hat.Name = 'Hat'
  129. hat.Anchored = false
  130. hat.CanCollide = false
  131. mesh = Instance.new('SpecialMesh', hat)
  132. mesh.MeshId = "http://www.roblox.com/asset/?id=111898512"
  133. mesh.TextureId = "http://www.roblox.com/asset/?id=111898570"
  134. mesh.Scale = Vector3.new(1,1,1)
  135. weld = Instance.new('Weld', hat)
  136. weld.Part0 = hat
  137. weld.Part1 = snpr.Head
  138. weld.C0 = CFrame.new(0,-0.4,0)
  139. --------------------------------------------
  140. local ptst4_mobile_armor_unit_left_leg = Instance.new("CharacterMesh")
  141. local ptst4_mobile_armor_unit_right_arm = Instance.new("CharacterMesh")
  142. local ptst4_mobile_armor_unit_right_leg = Instance.new("CharacterMesh")
  143. local ptst4_mobile_armor_unit_torso = Instance.new("CharacterMesh")
  144. local ptst4_mobile_armor_unit_left_arm = Instance.new("CharacterMesh")
  145. ---------------------------------------------------------------------------
  146. ptst4_mobile_armor_unit_left_leg.Name = "PT-ST4 Mobile Armor Unit Left Leg"
  147. ptst4_mobile_armor_unit_left_leg.OverlayTextureId = 182378991
  148. ptst4_mobile_armor_unit_left_leg.MeshId = 111777942
  149. ptst4_mobile_armor_unit_left_leg.BodyPart = Enum.BodyPart.LeftLeg
  150. ptst4_mobile_armor_unit_left_leg.Parent = teh_gurd
  151. ptst4_mobile_armor_unit_right_arm.Name = "PT-ST4 Mobile Armor Unit Right Arm"
  152. ptst4_mobile_armor_unit_right_arm.OverlayTextureId = 182378991
  153. ptst4_mobile_armor_unit_right_arm.MeshId = 111777972
  154. ptst4_mobile_armor_unit_right_arm.BodyPart = Enum.BodyPart.RightArm
  155. ptst4_mobile_armor_unit_right_arm.Parent = teh_gurd
  156. ptst4_mobile_armor_unit_right_leg.Name = "PT-ST4 Mobile Armor Unit Right Leg"
  157. ptst4_mobile_armor_unit_right_leg.OverlayTextureId = 182378991
  158. ptst4_mobile_armor_unit_right_leg.MeshId = 111778023
  159. ptst4_mobile_armor_unit_right_leg.BodyPart = Enum.BodyPart.RightLeg
  160. ptst4_mobile_armor_unit_right_leg.Parent = teh_gurd
  161. ptst4_mobile_armor_unit_torso.Name = "PT-ST4 Mobile Armor Unit Torso"
  162. ptst4_mobile_armor_unit_torso.OverlayTextureId = 182378991
  163. ptst4_mobile_armor_unit_torso.MeshId = 111777866
  164. ptst4_mobile_armor_unit_torso.BodyPart = Enum.BodyPart.Torso
  165. ptst4_mobile_armor_unit_torso.Parent = teh_gurd
  166. ptst4_mobile_armor_unit_left_arm.Name = "PT-ST4 Mobile Armor Unit Left Arm"
  167. ptst4_mobile_armor_unit_left_arm.OverlayTextureId = 182378991
  168. ptst4_mobile_armor_unit_left_arm.MeshId = 111777907
  169. ptst4_mobile_armor_unit_left_arm.BodyPart = Enum.BodyPart.LeftArm
  170. ptst4_mobile_armor_unit_left_arm.Parent = teh_gurd
  171. ------------------------------------------------
  172. sniper = Instance.new('Part', snpr)
  173. sniper.Anchored = false
  174. sniper.CanCollide = false
  175. sniper.Name = "Sniper"
  176. sniper.Size = Vector3.new(7.88, 1.77, 1)
  177. mesh = Instance.new('SpecialMesh', sniper)
  178. mesh.MeshId = "rbxassetid://462309398"
  179. mesh.TextureId = "rbxassetid://462309404"
  180. mesh.Scale = Vector3.new(0.006, 0.006, 0.006)
  181. weld = Instance.new('Weld', sniper)
  182. weld.Part0 = sniper
  183. weld.Part1 = snpr.Head
  184. weld.C0 = CFrame.new(-2,0.5,-0.2) * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))
  185.  
  186. arms = {snpr:FindFirstChild("Left Arm"), snpr:FindFirstChild("Right Arm")}
  187. torso = snpr:FindFirstChild("Torso")
  188.  
  189. if arms ~= nil and torso ~= nil then
  190. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  191. if sh ~= nil then
  192. local yes = true
  193. if yes then
  194. yes = false
  195. sh[1].Part1 = nil
  196. sh[2].Part1 = nil
  197. local weld1 = Instance.new("Weld")
  198. weld1.Part0 = torso
  199. weld1.Parent = torso
  200. weld1.Part1 = arms[1]
  201. weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  202. welds[1] = weld1
  203. local weld2 = Instance.new("Weld")
  204. weld2.Part0 = torso
  205. weld2.Parent = torso
  206. weld2.Part1 = arms[2]
  207. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  208. welds[2] = weld2
  209. end
  210. end
  211. end
  212.  
  213. function sniper(pos)
  214. if sam <= max - 1 then
  215. local sniper = snpr:Clone()
  216. local bodyc = sniper:FindFirstChildOfClass'BodyColors'
  217. local skincolor = skinc[math.random(1,5)]
  218.  
  219. for _, a in pairs(props) do
  220. bodyc[a] = BrickColor.new(skincolor)
  221. end
  222.  
  223. sniper.Parent = char
  224. sniper:MoveTo(pos)
  225. sniper.Torso.CFrame = CFrame.new(sniper.Torso.Position, head.Position)
  226. table.insert(snipers, sniper)
  227. sam = sam + 1
  228. end
  229. end
  230.  
  231. function rifler(pos)
  232. if sam <= max1 - 1 then
  233. local rifler = snpr:Clone()
  234. local bodyc = rifler:FindFirstChildOfClass'BodyColors'
  235. local skincolor = skinc[math.random(1,5)]
  236.  
  237. for _, a in pairs(props) do
  238. bodyc[a] = BrickColor.new(skincolor)
  239. end
  240.  
  241. for _, a in pairs(rifler:GetDescendants()) do
  242. if a:IsA'BodyGyro' then
  243. a:Destroy()
  244. end
  245. end
  246.  
  247. rifler.Parent = char
  248. rifler:MoveTo(pos)
  249. rifler.Torso.CFrame = CFrame.new(rifler.Torso.Position, head.Position)
  250. rifler:FindFirstChild'SNIPERSOUND'.Pitch = 1.2
  251. rifle = rifler:FindFirstChild'Sniper'
  252. rifle.Name = "Rifle"
  253. rifle:FindFirstChildOfClass'SpecialMesh'.TextureId = "rbxassetid://546505949"
  254. rifle:FindFirstChildOfClass'SpecialMesh'.MeshId = "rbxassetid://546505802"
  255. rifle:FindFirstChildOfClass'SpecialMesh'.Scale = Vector3.new(0.2, 0.2, 0.2)
  256. rifle:FindFirstChildOfClass'Weld'.C0 = CFrame.new(-.4,.6,1.6) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  257. table.insert(riflers, rifler)
  258. sam = sam + 1
  259. end
  260. end
  261.  
  262. function ray(a,b)
  263. local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700)
  264. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  265.  
  266. local beam = Instance.new("Part", workspace)
  267. beam.FormFactor = "Custom"
  268. beam.Material = "Plastic"
  269. beam.Transparency = 0.25
  270. beam.Anchored = true
  271. beam.Locked = true
  272. beam.CanCollide = false
  273. beam.BrickColor = BrickColor.new('Really black')
  274.  
  275. local distance = (a.CFrame.p - position).magnitude
  276. beam.Size = Vector3.new(0.08, 0.08, distance)
  277. beam.CFrame = CFrame.new(a.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  278.  
  279. game:GetService('Debris'):AddItem(beam, 0.1)
  280. end
  281.  
  282. mouse.KeyDown:connect(function(k)
  283. local key = k:lower()
  284. if key == "x" then
  285. follow = false
  286. if mode == "Snipers" then
  287. sniper(mouse.Hit.p)
  288. elseif mode == "Riflers" then
  289. rifler(mouse.Hit.p)
  290. end
  291. wait(.3)
  292. if curfollow then
  293. follow = true
  294. elseif not curfollow then
  295. follow = false
  296. end
  297. elseif key == "c" then
  298. for _, a in pairs(char:children()) do
  299. if a.Name == "" then
  300. for i = 1,10 do
  301. a:FindFirstChild'HumanoidRootPart'.CFrame = a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0)
  302. wait()
  303. end
  304. wait(.15)
  305. a:Destroy()
  306. sam = sam - 1
  307. end
  308. end
  309. elseif key == "m" then
  310. if mode == "Snipers" then
  311. mode = "Riflers"
  312. elseif mode == "Riflers" then
  313. mode = "Snipers"
  314. end
  315. elseif key == "q" then
  316. if not follow then
  317. follow = true
  318. curfollow = true
  319. on = false
  320. for i = 1, sam / 2 do
  321. wait(.6)
  322. local now
  323. ypcall(function()
  324. if mode == "Snipers" then
  325. now = snipers[math.random(1,#snipers)]
  326. elseif mode == "Riflers" then
  327. now = riflers[math.random(1,#riflers)]
  328. end
  329. end)
  330. for _, a in pairs(riflers) do
  331. bg = Instance.new("BodyGyro", a.HumanoidRootPart)
  332. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  333. bg.Name = "FOLLOW"
  334. bg.P = 10000
  335. bg.D = 100
  336. end
  337. now.Head.Sound:Resume()
  338. current = now.Head.Sound.SoundId
  339. end
  340. elseif follow then
  341. for _, a in pairs(riflers) do
  342. for _, b in pairs(a:GetDescendants()) do
  343. if b:IsA'BodyGyro' then
  344. b:Destroy()
  345. end
  346. end
  347. end
  348. follow = false
  349. curfollow = false
  350. end
  351. end
  352. end)
  353.  
  354. mouse.Button1Down:connect(function()
  355. if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then
  356. follow = false
  357. local targ = mouse.Target
  358. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  359. for _, a in pairs(targ.Parent:children()) do
  360. if a:IsA'ForceField' then
  361. a:Destroy()
  362. end
  363. end
  364. huma.MaxHealth = 200
  365. huma.Name = "Humanoid"
  366. if mode == "Snipers" then
  367. for _, a in pairs(snipers) do
  368. if a:FindFirstChild'HumanoidRootPart' then
  369. wait(.2)
  370. rootpart = a.HumanoidRootPart
  371. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  372. snd:Play()
  373. ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position)
  374. huma:TakeDamage(huma.MaxHealth/2/2/2)
  375. end
  376. end
  377. follow = true
  378. end
  379. end
  380. end)
  381.  
  382. mouse.Button1Down:connect(function()
  383. if mode == "Riflers" then
  384. rifleshoot = true
  385. end
  386. end)
  387.  
  388. mouse.Button1Up:connect(function()
  389. if mode == "Riflers" then
  390. rifleshoot = false
  391. end
  392. end)
  393.  
  394. while wait() do
  395. ypcall(function()
  396. riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position)
  397. riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position)
  398. end)
  399. if follow then
  400. if mode == "Snipers" then
  401. for _, a in pairs(snipers) do
  402. if a:FindFirstChild'HumanoidRootPart' then
  403. rootpart = a.HumanoidRootPart
  404. rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0))
  405. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  406. end
  407. end
  408. elseif mode == "Riflers" then
  409. for _, a in pairs(riflers) do
  410. if a:FindFirstChild'HumanoidRootPart' then
  411. rootpart = a.HumanoidRootPart
  412. 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)
  413. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  414. end
  415. end
  416. end
  417. end
  418. if rifleshoot and follow and mouse.Target and mouse.Target.Parent then
  419. local targ = mouse.Target
  420. local huma = nil
  421. if targ.Parent:FindFirstChildOfClass'Humanoid' then
  422. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  423. else
  424. huma = nil
  425. end
  426. if huma ~= nil then
  427. for _, a in pairs(riflers) do
  428. if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0 then
  429. wait(.02)
  430. rootpart = a.HumanoidRootPart
  431. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  432. snd.Pitch = 80
  433. snd:Resume()
  434. ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position)
  435. huma:TakeDamage(huma.MaxHealth/2/2/2/2/2)
  436. end
  437. end
  438. else
  439. for _, a in pairs(riflers) do
  440. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  441. snd.Pitch = 80
  442. snd:Resume()
  443. ray(a:FindFirstChild'Rifle',mouse.Hit.p)
  444. end
  445. end
  446. end
  447. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement