GalaxyDelta

Untitled

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