Advertisement
cobblecorn

Untitled

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