Advertisement
soubrhomi

Untitled

Sep 28th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.18 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  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. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. local Me = owner
  88. local Char = Me.Character
  89. local Torso = Char.Torso
  90. local TickWait = 1
  91. local Color = "Medium stone gray"
  92. local Dead = false
  93.  
  94. local Tool = Instance.new("HopperBin", Me.Backpack)
  95. Tool.Name = "Bomb Vest"
  96.  
  97. local Position = Vector3.new(0,100,0)
  98. function NewPart(Parent)
  99. local Part = Instance.new("Part", Parent)
  100. Part.CanCollide = false
  101. Part.FormFactor = "Custom"
  102. Part.Position = Position
  103. Part.TopSurface = "Smooth"
  104. Part.BottomSurface = "Smooth"
  105. Part.BrickColor = BrickColor.new(Color)
  106. Position = Position + Vector3.new(0,Part.Size.Y + 10,0)
  107. return Part
  108. end
  109.  
  110. local Model = Char:FindFirstChild("Bomb")
  111. if Model then Model:Destroy() end
  112.  
  113. Model = Instance.new("Model", Char)
  114. Model.Name = "Bomb"
  115.  
  116. local Belt = NewPart(Model)
  117. Belt.Size = Vector3.new(2.2,0.5,1.2)
  118. local Weld = Instance.new("Weld", Belt)
  119. Weld.Part0 = Belt
  120. Weld.Part1 = Torso
  121. Weld.C0 = CFrame.new(0,1.1,0)
  122. local Light = Instance.new("PointLight", Belt)
  123. Light.Range = 15
  124. Light.Brightness = 5
  125. Light.Color = Color3.new(1,0,0)
  126. local Beep = Instance.new("Sound", Belt)
  127. Beep.SoundId = "http://www.roblox.com/asset/?id=188588790"
  128. local ExplodeSound = Instance.new("Sound", Belt)
  129. ExplodeSound.SoundId = "http://www.roblox.com/asset/?id="..(tonumber((math.ceil(1776.66^2)+17).."."..string.rep("36",3))*77)+0.00003 --144507765
  130. ExplodeSound.Pitch = 2.8
  131. ExplodeSound.Volume = 3
  132.  
  133. local Back = NewPart(Model)
  134. Back.Size = Vector3.new(1.5,1.5,0.5)
  135. local Weld = Instance.new("Weld", Back)
  136. Weld.Part0 = Back
  137. Weld.Part1 = Torso
  138. Weld.C0 = CFrame.new(0,0.1,-0.75)
  139.  
  140. local StrapLeft = NewPart(Model)
  141. StrapLeft.Size = Vector3.new(0.2,0.5,1.6)
  142. local Weld = Instance.new("Weld", StrapLeft)
  143. Weld.Part0 = StrapLeft
  144. Weld.Part1 = Torso
  145. Weld.C0 = CFrame.new(0.65,-0.9,-0.2)
  146.  
  147. local BuckleLeft = NewPart(Model)
  148. BuckleLeft.Size = Vector3.new(0.2,1.5,0.2)
  149. local Weld = Instance.new("Weld", BuckleLeft)
  150. Weld.Part0 = BuckleLeft
  151. Weld.Part1 = Torso
  152. Weld.C0 = CFrame.new(0.65,0.1,0.5)
  153.  
  154. local StrapRight = NewPart(Model)
  155. StrapRight.Size = Vector3.new(0.2,0.5,1.6)
  156. local Weld = Instance.new("Weld", StrapRight)
  157. Weld.Part0 = StrapRight
  158. Weld.Part1 = Torso
  159. Weld.C0 = CFrame.new(-0.65,-0.9,-0.2)
  160.  
  161. local BuckleRight = NewPart(Model)
  162. BuckleRight.Size = Vector3.new(0.2,1.5,0.2)
  163. local Weld = Instance.new("Weld", BuckleRight)
  164. Weld.Part0 = BuckleRight
  165. Weld.Part1 = Torso
  166. Weld.C0 = CFrame.new(-0.65,0.1,0.5)
  167.  
  168. Tool.Selected:connect(function(Mouse)
  169. TickWait = 0.3
  170. Mouse.Icon = "http://www.roblox.com/asset/?id=9109985"
  171.  
  172. Mouse.Button1Down:connect(function()
  173. if Dead == false then
  174. Dead = true
  175. ExplodeSound:Play()
  176. wait(1.4)
  177. local Explosion = Instance.new("Explosion", Workspace)
  178. Explosion.Position = Belt.Position
  179. Explosion.BlastPressure = 100000
  180. Explosion.DestroyJointRadiusPercent = 0.7
  181. Explosion.ExplosionType = "CratersAndDebris"
  182. Explosion.BlastRadius = 50
  183. Explosion.Hit:connect(function(Part, Distance)
  184. Part.Anchored = false
  185. if Distance <= 10 then
  186. Part:BreakJoints()
  187. end
  188. end)
  189. end
  190. end)
  191. end)
  192.  
  193. Tool.Deselected:connect(function()
  194. TickWait = 1
  195. end)
  196.  
  197. coroutine.wrap(function()
  198. repeat
  199. wait(TickWait)
  200. Light.Enabled = not Light.Enabled
  201. Beep:Play()
  202. until Dead == true
  203. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement