Advertisement
ItzInfern

bomb vest

Jan 27th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1.  
  2.  
  3. --https://github.com/Mokiros/roblox-FE-compatibility
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. local RealPlayer = Player
  7. 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
  8.  
  9.  
  10.  
  11. local Me = game:GetService("Players").LocalPlayer
  12. local Char = Me.Character
  13. local Torso = Char.Torso
  14. local TickWait = 1
  15. local Color = "Medium stone gray"
  16. local Dead = false
  17.  
  18. local Tool = Instance.new("HopperBin", Me.Backpack)
  19. Tool.Name = "Bomb Vest"
  20.  
  21. local Position = Vector3.new(0,100,0)
  22. function NewPart(Parent)
  23. local Part = Instance.new("Part", Parent)
  24. Part.CanCollide = false
  25. Part.FormFactor = "Custom"
  26. Part.Position = Position
  27. Part.TopSurface = "Smooth"
  28. Part.BottomSurface = "Smooth"
  29. Part.BrickColor = BrickColor.new(Color)
  30. Position = Position + Vector3.new(0,Part.Size.Y + 10,0)
  31. return Part
  32. end
  33.  
  34. local Model = Char:FindFirstChild("Bomb")
  35. if Model then Model:Destroy() end
  36.  
  37. Model = Instance.new("Model", Char)
  38. Model.Name = "Bomb"
  39.  
  40. local Belt = NewPart(Model)
  41. Belt.Size = Vector3.new(2.2,0.5,1.2)
  42. local Weld = Instance.new("Weld", Belt)
  43. Weld.Part0 = Belt
  44. Weld.Part1 = Torso
  45. Weld.C0 = CFrame.new(0,1.1,0)
  46. local Light = Instance.new("PointLight", Belt)
  47. Light.Range = 15
  48. Light.Brightness = 5
  49. Light.Color = Color3.new(1,0,0)
  50. local Beep = Instance.new("Sound", Belt)
  51. Beep.SoundId = "http://www.roblox.com/asset/?id=188588790"
  52. local ExplodeSound = Instance.new("Sound", Belt)
  53. ExplodeSound.SoundId = "http://www.roblox.com/asset/?id="..(tonumber((math.ceil(1776.66^2)+17).."."..string.rep("36",3))*77)+0.00003 --144507765
  54. ExplodeSound.Pitch = 2.8
  55. ExplodeSound.Volume = 3
  56.  
  57. local Back = NewPart(Model)
  58. Back.Size = Vector3.new(1.5,1.5,0.5)
  59. local Weld = Instance.new("Weld", Back)
  60. Weld.Part0 = Back
  61. Weld.Part1 = Torso
  62. Weld.C0 = CFrame.new(0,0.1,-0.75)
  63.  
  64. local StrapLeft = NewPart(Model)
  65. StrapLeft.Size = Vector3.new(0.2,0.5,1.6)
  66. local Weld = Instance.new("Weld", StrapLeft)
  67. Weld.Part0 = StrapLeft
  68. Weld.Part1 = Torso
  69. Weld.C0 = CFrame.new(0.65,-0.9,-0.2)
  70.  
  71. local BuckleLeft = NewPart(Model)
  72. BuckleLeft.Size = Vector3.new(0.2,1.5,0.2)
  73. local Weld = Instance.new("Weld", BuckleLeft)
  74. Weld.Part0 = BuckleLeft
  75. Weld.Part1 = Torso
  76. Weld.C0 = CFrame.new(0.65,0.1,0.5)
  77.  
  78. local StrapRight = NewPart(Model)
  79. StrapRight.Size = Vector3.new(0.2,0.5,1.6)
  80. local Weld = Instance.new("Weld", StrapRight)
  81. Weld.Part0 = StrapRight
  82. Weld.Part1 = Torso
  83. Weld.C0 = CFrame.new(-0.65,-0.9,-0.2)
  84.  
  85. local BuckleRight = NewPart(Model)
  86. BuckleRight.Size = Vector3.new(0.2,1.5,0.2)
  87. local Weld = Instance.new("Weld", BuckleRight)
  88. Weld.Part0 = BuckleRight
  89. Weld.Part1 = Torso
  90. Weld.C0 = CFrame.new(-0.65,0.1,0.5)
  91.  
  92. Tool.Selected:connect(function(Mouse)
  93. TickWait = 0.3
  94. Mouse.Icon = "http://www.roblox.com/asset/?id=9109985"
  95.  
  96. Mouse.Button1Down:connect(function()
  97. if Dead == false then
  98. Dead = true
  99. ExplodeSound:Play()
  100. wait(1.4)
  101. local Explosion = Instance.new("Explosion", Workspace)
  102. Explosion.Position = Belt.Position
  103. Explosion.BlastPressure = 100000
  104. Explosion.DestroyJointRadiusPercent = 0.7
  105. Explosion.ExplosionType = "CratersAndDebris"
  106. Explosion.BlastRadius = 50
  107. Explosion.Hit:connect(function(Part, Distance)
  108. Part.Anchored = false
  109. if Distance <= 10 then
  110. Part:BreakJoints()
  111. end
  112. end)
  113. end
  114. end)
  115. end)
  116.  
  117. Tool.Deselected:connect(function()
  118. TickWait = 1
  119. end)
  120.  
  121. coroutine.wrap(function()
  122. repeat
  123. wait(TickWait)
  124. Light.Enabled = not Light.Enabled
  125. Beep:Play()
  126. until Dead == true
  127. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement