Advertisement
cobblecorn

Untitled

Jun 17th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.05 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 CastProperRay(StartPos, EndPos, Distance, Ignore)
  279. local DIRECTION = CF(StartPos,EndPos).lookVector
  280. return Raycast(StartPos, DIRECTION, Distance, Ignore)
  281. end
  282.  
  283. local HIT,HITPOS = CastProperRay(StartPosition, EndPos, MaxDist, Parent)
  284.  
  285. function ray(a,b)
  286. local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700)
  287. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  288.  
  289. local beam = Instance.new("Part", workspace)
  290. beam.FormFactor = "Custom"
  291. beam.Material = "Plastic"
  292. beam.Transparency = 0.25
  293. beam.Anchored = true
  294. beam.Locked = true
  295. beam.CanCollide = false
  296. beam.BrickColor = BrickColor.new('Really black')
  297.  
  298. local distance = (a.CFrame.p - position).magnitude
  299. beam.Size = Vector3.new(0.08, 0.08, distance)
  300. beam.CFrame = CFrame.new(a.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  301.  
  302. game:GetService('Debris'):AddItem(beam, 0.1)
  303. end
  304.  
  305. mouse.KeyDown:connect(function(k)
  306. local key = k:lower()
  307. if key == "x" then
  308. follow = false
  309. if mode == "Snipers" then
  310. sniper(mouse.Hit.p)
  311. elseif mode == "Riflers" then
  312. rifler(mouse.Hit.p)
  313. end
  314. wait(.3)
  315. if curfollow then
  316. follow = true
  317. elseif not curfollow then
  318. follow = false
  319. end
  320. elseif key == "c" then
  321. for _, a in pairs(char:children()) do
  322. if a.Name == "" then
  323. for i = 1,10 do
  324. a:FindFirstChild'HumanoidRootPart'.CFrame = a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0)
  325. wait()
  326. end
  327. wait(.15)
  328. a:Destroy()
  329. sam = sam - 1
  330. end
  331. end
  332. elseif key == "m" then
  333. if mode == "Snipers" then
  334. mode = "Riflers"
  335. elseif mode == "Riflers" then
  336. mode = "Snipers"
  337. end
  338. elseif key == "q" then
  339. if not follow then
  340. follow = true
  341. curfollow = true
  342. on = false
  343. for i = 1, sam / 2 do
  344. wait(.6)
  345. local now
  346. ypcall(function()
  347. if mode == "Snipers" then
  348. now = snipers[math.random(1,#snipers)]
  349. elseif mode == "Riflers" then
  350. now = riflers[math.random(1,#riflers)]
  351. end
  352. end)
  353. for _, a in pairs(riflers) do
  354. bg = Instance.new("BodyGyro", a.HumanoidRootPart)
  355. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  356. bg.Name = "FOLLOW"
  357. bg.P = 10000
  358. bg.D = 100
  359. end
  360. now.Head.Sound:Resume()
  361. current = now.Head.Sound.SoundId
  362. end
  363. elseif follow then
  364. for _, a in pairs(riflers) do
  365. for _, b in pairs(a:GetDescendants()) do
  366. if b:IsA'BodyGyro' then
  367. b:Destroy()
  368. end
  369. end
  370. end
  371. follow = false
  372. curfollow = false
  373. end
  374. end
  375. end)
  376.  
  377. mouse.Button1Down:connect(function() end)
  378. if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then
  379. follow = false
  380. local targ = mouse.Target
  381. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  382. for _, a in pairs(targ.Parent:children()) do
  383. if a:IsA'ForceField' then
  384. a:Destroy()
  385. end
  386. end
  387.  
  388. huma.MaxHealth = 15e15
  389. huma.Name = "Humanoid"
  390. if mode == "Snipers" then
  391. for _, a in pairs(snipers) do
  392. if a:FindFirstChild'HumanoidRootPart' then
  393. wait(.2)
  394. rootpart = a.HumanoidRootPart
  395. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  396. snd:Play()
  397. ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position)
  398. huma:BreakJoints()
  399. wait(1)
  400. huma:Banish(char)
  401. end
  402. end
  403. end
  404. end
  405. follow = true
  406.  
  407.  
  408.  
  409.  
  410. mouse.Button1Down:connect(function()
  411. if mode == "Riflers" then
  412. rifleshoot = true
  413. end
  414. end)
  415.  
  416. mouse.Button1Up:connect(function()
  417. if mode == "Riflers" then
  418. rifleshoot = false
  419. end
  420. end)
  421.  
  422. while wait() do
  423. ypcall(function()
  424. riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position)
  425. riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position)
  426. end)
  427. if follow then
  428. if mode == "Snipers" then
  429. for _, a in pairs(snipers) do
  430. if a:FindFirstChild'HumanoidRootPart' then
  431. rootpart = a.HumanoidRootPart
  432. rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0))
  433. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  434. end
  435. end
  436. elseif mode == "Riflers" then
  437. for _, a in pairs(riflers) do
  438. if a:FindFirstChild'HumanoidRootPart' then
  439. rootpart = a.HumanoidRootPart
  440. 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)
  441. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  442. end
  443. end
  444. end
  445. end
  446. if rifleshoot and follow and mouse.Target and mouse.Target.Parent then
  447. local targ = mouse.Target
  448. local huma = nil
  449. if targ.Parent:FindFirstChildOfClass'Humanoid' then
  450. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  451. else
  452. huma = nil
  453. end
  454. if huma ~= nil then
  455. for _, a in pairs(riflers) do
  456. if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0 then
  457. wait(.02)
  458. rootpart = a.HumanoidRootPart
  459. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  460. snd.Pitch = 80
  461. snd:Resume()
  462. ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position)
  463. huma:Banish(char)
  464. end
  465. end
  466. else
  467. for _, a in pairs(riflers) do
  468. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  469. snd.Pitch = 80
  470. snd:Resume()
  471. ray(a:FindFirstChild'Rifle',mouse.Hit.p)
  472. end
  473. end
  474. end
  475. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement