TheRobloxFanGamer

new body guard

Mar 12th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.37 KB | None | 0 0
  1. -- Location: Players.Cronizete.Character.BODYGUARDSV2
  2. -- Synapse Decompiler
  3. -- Purchase Here: https://brack4712.xyz/synapse/purchase
  4.  
  5. --// Controls
  6. --// X = Summon a bodyguard
  7. --// M = Change Types of bodyguards (Snipers, riflers) Sniper is the default
  8. --// Q = Aim
  9. --// C = Makes all the bodyguards disappear.
  10. --// Click = Shoot (You have to aim at somebody for snipers, you don't have to for the rifles)
  11.  
  12. plr = game:service'Players'.LocalPlayer
  13. char = plr.Character
  14.  
  15. --// Anti double
  16. script.Name = "BODYGUARDSV2_TEMP"
  17. for _, a in pairs(char:GetDescendants()) do
  18. if a.Name == "BODYGUARDSV2" then
  19. a:Destroy()
  20. elseif a.Name == "" then
  21. a:Destroy()
  22. end
  23. end
  24. script.Name = "BODYGUARDSV2"
  25. --// Main Script
  26.  
  27. head = char.Head
  28. mouse = plr:GetMouse()
  29. sam = 0
  30. char.Archivable = true
  31. arms = nil
  32. torso = nil
  33. follow = false
  34. current = nil
  35. curfollow = nil
  36. rifleshoot = false
  37. targ, huma = nil,nil
  38.  
  39. --// points
  40. point1 = Instance.new('Part', char)
  41. point1.Anchored = false
  42. point1.CanCollide = false
  43. point1.Transparency = 1
  44. point1.Size = Vector3.new(0.2,0.2,0.2)
  45.  
  46. Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
  47. Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
  48. Weld.Part1 = point1
  49. Weld.C1 = CFrame.new(10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  50.  
  51. point2 = Instance.new('Part', char)
  52. point2.Anchored = false
  53. point2.CanCollide = false
  54. point2.Transparency = 1
  55. point2.Size = Vector3.new(0.2,0.2,0.2)
  56.  
  57. Weld = Instance.new("Weld",game.Players.LocalPlayer.Character)
  58. Weld.Part0 = game.Players.LocalPlayer.Character["Torso"]
  59. Weld.Part1 = point2
  60. Weld.C1 = CFrame.new(-10, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
  61. --// points
  62.  
  63. --// Configuration
  64.  
  65. max = 15
  66. max1 = 2
  67. maxammo = 30
  68. mode = "Snipers"
  69.  
  70. --//
  71.  
  72. snipers,riflers,welds = {},{},{}
  73.  
  74. skinc = {
  75. 'Rust',
  76. 'Cool yellow',
  77. 'Br. yellowish orange',
  78. 'Pastel yellow',
  79. 'CGA brown'
  80. }
  81.  
  82. props = {
  83. 'HeadColor',
  84. 'LeftArmColor',
  85. 'RightArmColor',
  86. 'TorsoColor',
  87. 'RightLegColor',
  88. 'LeftLegColor'
  89. }
  90.  
  91. snpr = char:Clone()
  92. snpr.Name = ""
  93.  
  94. for _, a in pairs(snpr:children()) do
  95. if a:IsA'CharacterMesh' or a:IsA'Accessory' or a:IsA'Shirt' or a:IsA'Pants' then
  96. a:Destroy()
  97. end
  98. end
  99.  
  100. snpr.Parent = nil
  101.  
  102. bg = Instance.new("BodyGyro", snpr.HumanoidRootPart)
  103. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  104. bg.Name = "FOLLOW"
  105. bg.P = 10000
  106. bg.D = 100
  107.  
  108. sfx = Instance.new('Sound', snpr.Head)
  109. sfx.SoundId = "rbxassetid://740599871"
  110. sfx.Volume = 3
  111. sfx2 = Instance.new('Sound', snpr)
  112. sfx2.Name = "SNIPERSOUND"
  113. sfx2.SoundId = "rbxassetid://136523485"
  114. sfx2.Volume = 3
  115.  
  116. lazor = Instance.new('Part', snpr)
  117. lazor.Name = "Laser"
  118. lazor.Anchored = true
  119. lazor.Shape = Enum.PartType.Ball
  120. lazor.Size = Vector3.new(0.3,0.3,0.3)
  121. lazor.BrickColor = BrickColor.new('Really red')
  122. lazor.Transparency = 0.4
  123. lazor.CanCollide = false
  124.  
  125. shirt = Instance.new('Shirt', snpr)
  126. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=139465409"
  127. pants = Instance.new('Pants', snpr)
  128. pants.PantsTemplate = "http://www.roblox.com/asset/?id=139466214"
  129. ----------------------------------------------------------------
  130. hat = Instance.new('Part', snpr)
  131. hat.Name = 'Hat'
  132. hat.Anchored = false
  133. hat.CanCollide = false
  134. mesh = Instance.new('SpecialMesh', hat)
  135. mesh.MeshId = "http://www.roblox.com/asset/?id=31152467"
  136. mesh.TextureId = "http://www.roblox.com/asset/?id=32002857"
  137. mesh.Scale = Vector3.new(1,1,1)
  138. weld = Instance.new('Weld', hat)
  139. weld.Part0 = hat
  140. weld.Part1 = snpr.Head
  141. weld.C0 = CFrame.new(0,-0.2,0)
  142. --------------------------------------------
  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.  
  157. arms = {snpr:FindFirstChild("Left Arm"), snpr:FindFirstChild("Right Arm")}
  158. torso = snpr:FindFirstChild("Torso")
  159.  
  160. if arms ~= nil and torso ~= nil then
  161. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  162. if sh ~= nil then
  163. local yes = true
  164. if yes then
  165. yes = false
  166. sh[1].Part1 = nil
  167. sh[2].Part1 = nil
  168. local weld1 = Instance.new("Weld")
  169. weld1.Part0 = torso
  170. weld1.Parent = torso
  171. weld1.Part1 = arms[1]
  172. weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  173. welds[1] = weld1
  174. local weld2 = Instance.new("Weld")
  175. weld2.Part0 = torso
  176. weld2.Parent = torso
  177. weld2.Part1 = arms[2]
  178. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  179. welds[2] = weld2
  180. end
  181. end
  182. end
  183.  
  184. function sniper(pos)
  185. if sam <= max - 1 then
  186. local sniper = snpr:Clone()
  187. local bodyc = sniper:FindFirstChildOfClass'BodyColors'
  188. local skincolor = skinc[math.random(1,5)]
  189.  
  190. for _, a in pairs(props) do
  191. bodyc[a] = BrickColor.new(skincolor)
  192. end
  193.  
  194. sniper.Parent = char
  195. sniper:MoveTo(pos)
  196. sniper.Torso.CFrame = CFrame.new(sniper.Torso.Position, head.Position)
  197. table.insert(snipers, sniper)
  198. sam = sam + 1
  199. end
  200. end
  201.  
  202. function rifler(pos)
  203. if sam <= max1 - 1 then
  204. local rifler = snpr:Clone()
  205. local bodyc = rifler:FindFirstChildOfClass'BodyColors'
  206. local skincolor = skinc[math.random(1,5)]
  207.  
  208. for _, a in pairs(props) do
  209. bodyc[a] = BrickColor.new(skincolor)
  210. end
  211.  
  212. for _, a in pairs(rifler:GetDescendants()) do
  213. if a:IsA'BodyGyro' then
  214. a:Destroy()
  215. end
  216. end
  217.  
  218. rifler.Parent = char
  219. rifler:MoveTo(pos)
  220. rifler.Torso.CFrame = CFrame.new(rifler.Torso.Position, head.Position)
  221. rifler:FindFirstChild'SNIPERSOUND'.Pitch = 1.2
  222. rifle = rifler:FindFirstChild'Sniper'
  223. rifle.Name = "Rifle"
  224. rifle:FindFirstChildOfClass'SpecialMesh'.TextureId = "rbxassetid://546505949"
  225. rifle:FindFirstChildOfClass'SpecialMesh'.MeshId = "rbxassetid://546505802"
  226. rifle:FindFirstChildOfClass'SpecialMesh'.Scale = Vector3.new(0.2, 0.2, 0.2)
  227. rifle:FindFirstChildOfClass'Weld'.C0 = CFrame.new(-.4,.6,1.6) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  228. table.insert(riflers, rifler)
  229. sam = sam + 1
  230. end
  231. end
  232.  
  233. function ray(a,b)
  234. local ray = Ray.new(a.CFrame.p, (b - a.CFrame.p).unit * 700)
  235. local part, position = workspace:FindPartOnRay(ray, char, false, true)
  236.  
  237. local beam = Instance.new("Part", workspace)
  238. beam.FormFactor = "Custom"
  239. beam.Material = "Plastic"
  240. beam.Transparency = 0.25
  241. beam.Anchored = true
  242. beam.Locked = true
  243. beam.CanCollide = false
  244. beam.BrickColor = BrickColor.new('Really black')
  245.  
  246. local distance = (a.CFrame.p - position).magnitude
  247. beam.Size = Vector3.new(0.08, 0.08, distance)
  248. beam.CFrame = CFrame.new(a.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)
  249.  
  250. game:GetService('Debris'):AddItem(beam, 0.1)
  251. end
  252.  
  253. mouse.KeyDown:connect(function(k)
  254. local key = k:lower()
  255. if key == "x" then
  256. follow = false
  257. if mode == "Snipers" then
  258. sniper(mouse.Hit.p)
  259. elseif mode == "Riflers" then
  260. rifler(mouse.Hit.p)
  261. end
  262. wait(.3)
  263. if curfollow then
  264. follow = true
  265. elseif not curfollow then
  266. follow = false
  267. end
  268. elseif key == "c" then
  269. for _, a in pairs(char:children()) do
  270. if a.Name == "" then
  271. for i = 1,10 do
  272. a:FindFirstChild'HumanoidRootPart'.CFrame = a:FindFirstChild'HumanoidRootPart'.CFrame * CFrame.new(0,-i + 0.8,0)
  273. wait()
  274. end
  275. wait(.15)
  276. a:Destroy()
  277. sam = sam - 1
  278. end
  279. end
  280. elseif key == "m" then
  281. if mode == "Snipers" then
  282. mode = "Riflers"
  283. elseif mode == "Riflers" then
  284. mode = "Snipers"
  285. end
  286. elseif key == "q" then
  287. if not follow then
  288. follow = true
  289. curfollow = true
  290. on = false
  291. for i = 1, sam / 2 do
  292. wait(.6)
  293. local now
  294. ypcall(function()
  295. if mode == "Snipers" then
  296. now = snipers[math.random(1,#snipers)]
  297. elseif mode == "Riflers" then
  298. now = riflers[math.random(1,#riflers)]
  299. end
  300. end)
  301. for _, a in pairs(riflers) do
  302. bg = Instance.new("BodyGyro", a.HumanoidRootPart)
  303. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  304. bg.Name = "FOLLOW"
  305. bg.P = 10000
  306. bg.D = 100
  307. end
  308. now.Head.Sound:Resume()
  309. current = now.Head.Sound.SoundId
  310. end
  311. elseif follow then
  312. for _, a in pairs(riflers) do
  313. for _, b in pairs(a:GetDescendants()) do
  314. if b:IsA'BodyGyro' then
  315. b:Destroy()
  316. end
  317. end
  318. end
  319. follow = false
  320. curfollow = false
  321. end
  322. end
  323. end)
  324.  
  325. mouse.Button1Down:connect(function()
  326. if follow and mode ~= "Riflers" and mouse.Target and mouse.Target.Parent and mouse.Target.Parent:FindFirstChildOfClass'Humanoid' then
  327. follow = false
  328. local targ = mouse.Target
  329. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  330. for _, a in pairs(targ.Parent:children()) do
  331. if a:IsA'ForceField' then
  332. a:Destroy()
  333. end
  334. end
  335. huma.MaxHealth = 100
  336. huma.Name = "Humanoid"
  337. if mode == "Snipers" then
  338. for _, a in pairs(snipers) do
  339. if a:FindFirstChild'HumanoidRootPart' then
  340. wait(.2)
  341. rootpart = a.HumanoidRootPart
  342. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  343. snd:Play()
  344. ray(a:FindFirstChild'Sniper',targ.Parent.Head.Position)
  345. huma:TakeDamage(huma.MaxHealth/2/2/2)
  346. end
  347. end
  348. follow = true
  349. end
  350. end
  351. end)
  352.  
  353. mouse.Button1Down:connect(function()
  354. if mode == "Riflers" then
  355. rifleshoot = true
  356. end
  357. end)
  358.  
  359. mouse.Button1Up:connect(function()
  360. if mode == "Riflers" then
  361. rifleshoot = false
  362. end
  363. end)
  364.  
  365. while wait() do
  366. ypcall(function()
  367. riflers[1]:FindFirstChildOfClass'Humanoid':MoveTo(point1.Position)
  368. riflers[2]:FindFirstChildOfClass'Humanoid':MoveTo(point2.Position)
  369. end)
  370. if follow then
  371. if mode == "Snipers" then
  372. for _, a in pairs(snipers) do
  373. if a:FindFirstChild'HumanoidRootPart' then
  374. rootpart = a.HumanoidRootPart
  375. rootpart.FOLLOW.CFrame = CFrame.new(rootpart.Position, mouse.Hit.p * Vector3.new(1,0,1) + rootpart.Position * Vector3.new(0,1,0))
  376. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  377. end
  378. end
  379. elseif mode == "Riflers" then
  380. for _, a in pairs(riflers) do
  381. if a:FindFirstChild'HumanoidRootPart' then
  382. rootpart = a.HumanoidRootPart
  383. 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)
  384. rootpart.Parent:WaitForChild'Laser'.CFrame = mouse.Hit
  385. end
  386. end
  387. end
  388. end
  389. if rifleshoot and follow and mouse.Target and mouse.Target.Parent then
  390. local targ = mouse.Target
  391. local huma = nil
  392. if targ.Parent:FindFirstChildOfClass'Humanoid' then
  393. huma = targ.Parent:FindFirstChildOfClass'Humanoid'
  394. else
  395. huma = nil
  396. end
  397. if huma ~= nil then
  398. for _, a in pairs(riflers) do
  399. if a:FindFirstChild'HumanoidRootPart' and huma.Health ~= 0 then
  400. wait(.02)
  401. rootpart = a.HumanoidRootPart
  402. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  403. snd.Pitch = 80
  404. snd:Resume()
  405. ray(a:FindFirstChild'Rifle',targ.Parent.Head.Position)
  406. huma:TakeDamage(huma.MaxHealth/2/2/2/2/2)
  407. end
  408. end
  409. else
  410. for _, a in pairs(riflers) do
  411. snd = rootpart.Parent:FindFirstChild'SNIPERSOUND'
  412. snd.Pitch = 80
  413. snd:Resume()
  414. ray(a:FindFirstChild'Rifle',mouse.Hit.p)
  415. end
  416. end
  417. end
  418. end
Add Comment
Please, Sign In to add comment