Advertisement
cobblecorn

Untitled

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