Advertisement
cobblecorn

Untitled

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