PerpetualZblack

Untitled

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