Advertisement
cobblecorn

Untitled

Jun 17th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.81 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. VT = Vector3.new
  24. C3 = Color3.new
  25. head = char.Head
  26. mouse = plr:GetMouse()
  27. sam = 0
  28. char.Archivable = true
  29. arms = nil
  30. torso = nil
  31. follow = false
  32. current = nil
  33. curfollow = nil
  34. rifleshoot = false
  35. targ, huma = nil,nil
  36. CF = CFrame.new
  37.  
  38. --// points
  39. point1 = Instance.new('Part', char)
  40. point1.Anchored = false
  41. point1.CanCollide = false
  42. point1.Transparency = 1
  43. point1.Size = Vector3.new(0.2,0.2,0.2)
  44.  
  45. Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
  46. Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
  47. Weld.Part1 = point1
  48. Weld.C1 = CFrame.new(10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  49.  
  50. point2 = Instance.new('Part', char)
  51. point2.Anchored = false
  52. point2.CanCollide = false
  53. point2.Transparency = 1
  54. point2.Size = Vector3.new(0.2,0.2,0.2)
  55.  
  56. Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
  57. Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
  58. Weld.Part1 = point2
  59. Weld.C1 = CFrame.new(-10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  60. --// points
  61.  
  62. --// Configuration
  63.  
  64. max = 50
  65. max1 = 10
  66. maxammo = 50
  67. mode = "Snipers"
  68.  
  69. --//
  70.  
  71. snipers,riflers,welds = {},{},{}
  72.  
  73. skinc = {
  74. 'Pastel yellow',
  75. 'Pastel yellow',
  76. 'Pastel yellow',
  77. 'Pastel yellow',
  78. 'Pastel yellow'
  79. }
  80.  
  81. props = {
  82. 'HeadColor',
  83. 'LeftArmColor',
  84. 'RightArmColor',
  85. 'TorsoColor',
  86. 'RightLegColor',
  87. 'LeftLegColor'
  88. }
  89.  
  90. snpr = char:Clone()
  91. snpr.Name = ""
  92.  
  93. for _, a in pairs(snpr:children()) do
  94. if a:IsA'CharacterMesh' or a:IsA'Accessory' or a:IsA'Shirt' or a:IsA'Pants' then
  95. a:Destroy()
  96. end
  97. end
  98.  
  99. snpr.Parent = nil
  100.  
  101. bg = Instance.new("BodyGyro", snpr.HumanoidRootPart)
  102. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  103. bg.Name = "FOLLOW"
  104. bg.P = 10000
  105. bg.D = 100
  106.  
  107. sfx = Instance.new('Sound', snpr.Head)
  108. sfx.SoundId = "rbxassetid://740599871"
  109. sfx.Volume = 3
  110. sfx2 = Instance.new('Sound', snpr)
  111. sfx2.Name = "SNIPERSOUND"
  112. sfx2.SoundId = "rbxassetid://136523485"
  113. sfx2.Volume = 3
  114.  
  115. lazor = Instance.new('Part', snpr)
  116. lazor.Name = "Laser"
  117. lazor.Anchored = true
  118. lazor.Shape = Enum.PartType.Ball
  119. lazor.Size = Vector3.new(0.3,0.3,0.3)
  120. lazor.BrickColor = BrickColor.new('Bright blue')
  121. lazor.Transparency = 0.4
  122. lazor.CanCollide = false
  123.  
  124. shirt = Instance.new('Shirt', snpr)
  125. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=1161784003"
  126. pants = Instance.new('Pants', snpr)
  127. pants.PantsTemplate = "http://www.roblox.com/asset/?id=1161784003"
  128. ----------------------------------------------------------------
  129. hat = Instance.new('Part', snpr)
  130. hat.Name = 'Hat'
  131. hat.Anchored = false
  132. hat.CanCollide = false
  133. mesh = Instance.new('SpecialMesh', hat)
  134. mesh.MeshId = "http://www.roblox.com/asset/?id=111898512"
  135. mesh.TextureId = "http://www.roblox.com/asset/?id=111898570"
  136. mesh.Scale = Vector3.new(1,1,1)
  137. weld = Instance.new('Weld', hat)
  138. weld.Part0 = hat
  139. weld.Part1 = snpr.Head
  140. weld.C0 = CFrame.new(0,-0.4,0)
  141. --------------------------------------------
  142. IT = Instance.new
  143. sniper = Instance.new('Part', snpr)
  144. sniper.Anchored = false
  145. sniper.CanCollide = false
  146. sniper.Name = "Sniper"
  147. sniper.Size = Vector3.new(7.88, 1.77, 1)
  148. mesh = Instance.new('SpecialMesh', sniper)
  149. mesh.MeshId = "rbxassetid://462309398"
  150. mesh.TextureId = "rbxassetid://462309404"
  151. mesh.Scale = Vector3.new(0.006, 0.006, 0.006)
  152. weld = Instance.new('Weld', sniper)
  153. weld.Part0 = sniper
  154. weld.Part1 = snpr.Head
  155. weld.C0 = CFrame.new(-2,0.5,-0.2) * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0))
  156. local Effects = IT("Folder")
  157. Effects.Name = "Effects"
  158. arms = {snpr:FindFirstChild("Left Arm"), snpr:FindFirstChild("Right Arm")}
  159. torso = snpr:FindFirstChild("Torso")
  160.  
  161. if arms ~= nil and torso ~= nil then
  162. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  163. if sh ~= nil then
  164. local yes = true
  165. if yes then
  166. yes = false
  167. sh[1].Part1 = nil
  168. sh[2].Part1 = nil
  169. local weld1 = Instance.new("Weld")
  170. weld1.Part0 = torso
  171. weld1.Parent = torso
  172. weld1.Part1 = arms[1]
  173. weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  174. welds[1] = weld1
  175. local weld2 = Instance.new("Weld")
  176. weld2.Part0 = torso
  177. weld2.Parent = torso
  178. weld2.Part1 = arms[2]
  179. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  180. welds[2] = weld2
  181. end
  182. end
  183. end
  184.  
  185. Debris = game:GetService("Debris")
  186.  
  187. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  188. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  189. end
  190.  
  191. function Banish(Char)
  192. local NewCharacter = Instance.new("Model",Effects)
  193. NewCharacter.Name = "Ow im ded ;-;"
  194. for _, c in pairs(Char:GetDescendants()) do
  195. if c:IsA("BasePart") and c.Transparency == 0 then
  196. if c.Parent == Char then
  197. end
  198. c:BreakJoints()
  199. c.Material = "Smooth Plastic"
  200. c.Color = C3(0,0,0)
  201. c.CanCollide = true
  202. c.Transparency = 0.3
  203. if c:FindFirstChildOfClass("SpecialMesh") then
  204. c:FindFirstChildOfClass("SpecialMesh").TextureId = ""
  205. end
  206. if c.Name == "Head" then
  207. c:ClearAllChildren()
  208. c.Size = VT(c.Size.Y,c.Size.Y,c.Size.Y)
  209. end
  210. if c.ClassName == "MeshPart" then
  211. c.TextureID = ""
  212. end
  213. if c:FindFirstChildOfClass("BodyPosition") then
  214. c:FindFirstChildOfClass("BodyPosition"):remove()
  215. end
  216. if c:FindFirstChildOfClass("ParticleEmitter") then
  217. c:FindFirstChildOfClass("ParticleEmitter"):remove()
  218. end
  219. c.Parent = NewCharacter
  220. c.Name = "DeadPart"
  221. c.Velocity = VT(math.random(-45,45),math.random(-45,45),math.random(-45,45))/15
  222. c.RotVelocity = VT(math.random(-45,45),math.random(-15,85),math.random(-45,45))
  223. end
  224. end
  225. Char:remove()
  226. Debris:AddItem(NewCharacter,5)
  227. end
  228.  
  229. function sniper(pos)
  230. if sam <= max - 1 then
  231. local sniper = snpr:Clone()
  232. local bodyc = sniper:FindFirstChildOfClass'BodyColors'
  233. local skincolor = skinc[math.random(1,5)]
  234.  
  235. for _, a in pairs(props) do
  236. bodyc[a] = BrickColor.new(skincolor)
  237. end
  238.  
  239. sniper.Parent = char
  240. sniper:MoveTo(pos)
  241. sniper.Torso.CFrame = CFrame.new(sniper.Torso.Position, head.Position)
  242. table.insert(snipers, sniper)
  243. sam = sam + 1
  244. end
  245. end
  246.  
  247. function rifler(pos)
  248. if sam <= max1 - 1 then
  249. local rifler = snpr:Clone()
  250. local bodyc = rifler:FindFirstChildOfClass'BodyColors'
  251. local skincolor = skinc[math.random(1,5)]
  252.  
  253. for _, a in pairs(props) do
  254. bodyc[a] = BrickColor.new(skincolor)
  255. end
  256.  
  257. for _, a in pairs(rifler:GetDescendants()) do
  258. if a:IsA'BodyGyro' then
  259. a:Destroy()
  260. end
  261. end
  262.  
  263. rifler.Parent = char
  264. rifler:MoveTo(pos)
  265. rifler.Torso.CFrame = CFrame.new(rifler.Torso.Position, head.Position)
  266. rifler:FindFirstChild'SNIPERSOUND'.Pitch = 1.2
  267. rifle = rifler:FindFirstChild'Sniper'
  268. rifle.Name = "Rifle"
  269. rifle:FindFirstChildOfClass'SpecialMesh'.TextureId = "rbxassetid://546505949"
  270. rifle:FindFirstChildOfClass'SpecialMesh'.MeshId = "rbxassetid://546505802"
  271. rifle:FindFirstChildOfClass'SpecialMesh'.Scale = Vector3.new(0.2, 0.2, 0.2)
  272. rifle:FindFirstChildOfClass'Weld'.C0 = CFrame.new(-.4,.6,1.6) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  273. table.insert(riflers, rifler)
  274. sam = sam + 1
  275. end
  276. end
  277.  
  278. function ray(a,b)
  279. local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700)
  280. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  281.  
  282. local beam = Instance.new("Part", workspace)
  283. beam.FormFactor = "Custom"
  284. beam.Material = "Plastic"
  285. beam.Transparency = 0.25
  286. beam.Anchored = true
  287. beam.Locked = true
  288. beam.CanCollide = false
  289. beam.BrickColor = BrickColor.new('Really black')
  290.  
  291. local distance = (a.CFrame.p - position).magnitude
  292. beam.Size = Vector3.new(0.08, 0.08, distance)
  293. beam.CFrame = CFrame.new(a.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  294.  
  295. game:GetService('Debris'):AddItem(beam, 0.1)
  296. end
  297.  
  298. mouse.KeyDown:connect(function(k)
  299. local key = k:lower()
  300. if key == "x" then
  301. follow = false
  302. if mode == "Snipers" then
  303. sniper(mouse.Hit.p)
  304. elseif mode == "Riflers" then
  305. rifler(mouse.Hit.p)
  306. end
  307. wait(.3)
  308. if curfollow then
  309. follow = true
  310. elseif not curfollow then
  311. follow = false
  312. end
  313. elseif key == "c" then
  314. for _, a in pairs(char:children()) do
  315. if a.Name == "" then
  316. for i = 1,10 do
  317. a:FindFirstChild'HumanoidRootPart'.CFrame = a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0)
  318. wait()
  319. end
  320. wait(.15)
  321. a:Destroy()
  322. sam = sam - 1
  323. end
  324. end
  325. elseif key == "m" then
  326. if mode == "Snipers" then
  327. mode = "Riflers"
  328. elseif mode == "Riflers" then
  329. mode = "Snipers"
  330. end
  331. elseif key == "q" then
  332. if not follow then
  333. follow = true
  334. curfollow = true
  335. on = false
  336. for i = 1, sam / 2 do
  337. wait(.6)
  338. local now
  339. ypcall(function()
  340. if mode == "Snipers" then
  341. now = snipers[math.random(1,#snipers)]
  342. elseif mode == "Riflers" then
  343. now = riflers[math.random(1,#riflers)]
  344. end
  345. end)
  346. for _, a in pairs(riflers) do
  347. bg = Instance.new("BodyGyro", a.HumanoidRootPart)
  348. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  349. bg.Name = "FOLLOW"
  350. bg.P = 10000
  351. bg.D = 100
  352. end
  353. now.Head.Sound:Resume()
  354. current = now.Head.Sound.SoundId
  355. end
  356. elseif follow then
  357. for _, a in pairs(riflers) do
  358. for _, b in pairs(a:GetDescendants()) do
  359. if b:IsA'BodyGyro' then
  360. b:Destroy()
  361. end
  362. end
  363. end
  364. follow = false
  365. curfollow = false
  366. end
  367. end
  368. end)
  369.  
  370. mouse.Button1Down:connect(function() end)
  371. if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then
  372. follow = false
  373. local targ = mouse.Target
  374. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  375. for _, a in pairs(targ.Parent:children()) do
  376. if a:IsA'ForceField' then
  377. a:Destroy()
  378. end
  379. end
  380.  
  381. huma.MaxHealth = 15e15
  382. huma.Name = "Humanoid"
  383. if mode == "Snipers" then
  384. for _, a in pairs(snipers) do
  385. if a:FindFirstChild'HumanoidRootPart' then
  386. wait(.2)
  387. rootpart = a.HumanoidRootPart
  388. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  389. snd:Play()
  390. ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position)
  391. huma:BreakJoints()
  392. wait(1)
  393. huma:Banish(char)
  394. end
  395. end
  396. end
  397. end
  398. follow = true
  399.  
  400.  
  401.  
  402.  
  403. mouse.Button1Down:connect(function()
  404. if mode == "Riflers" then
  405. rifleshoot = true
  406. end
  407. end)
  408.  
  409. mouse.Button1Up:connect(function()
  410. if mode == "Riflers" then
  411. rifleshoot = false
  412. end
  413. end)
  414.  
  415. while wait() do
  416. ypcall(function()
  417. riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position)
  418. riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position)
  419. end)
  420. if follow then
  421. if mode == "Snipers" then
  422. for _, a in pairs(snipers) do
  423. if a:FindFirstChild'HumanoidRootPart' then
  424. rootpart = a.HumanoidRootPart
  425. rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0))
  426. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  427. end
  428. end
  429. elseif mode == "Riflers" then
  430. for _, a in pairs(riflers) do
  431. if a:FindFirstChild'HumanoidRootPart' then
  432. rootpart = a.HumanoidRootPart
  433. 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)
  434. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  435. end
  436. end
  437. end
  438. end
  439. if rifleshoot and follow and mouse.Target and mouse.Target.Parent then
  440. local targ = mouse.Target
  441. local huma = nil
  442. if targ.Parent:FindFirstChildOfClass'Humanoid' then
  443. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  444. else
  445. huma = nil
  446. end
  447. if huma ~= nil then
  448. for _, a in pairs(riflers) do
  449. if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0 then
  450. wait(.02)
  451. rootpart = a.HumanoidRootPart
  452. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  453. snd.Pitch = 80
  454. snd:Resume()
  455. ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position)
  456. huma:Banish(char)
  457. end
  458. end
  459. else
  460. for _, a in pairs(riflers) do
  461. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  462. snd.Pitch = 80
  463. snd:Resume()
  464. ray(a:FindFirstChild'Rifle',mouse.Hit.p)
  465. end
  466. end
  467. end
  468. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement