Pou_help

Untitled

Jan 24th, 2019
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 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. for i,v in pairs (game.Workspace:GetChildren()) do
  87. if v.Name == "Nuke" then
  88. v:Destroy()
  89. end
  90. end
  91. wait(1)
  92. local Tool = Instance.new("HopperBin", owner.Backpack)
  93. Tool.Name = "Detonater"
  94. local Mouse = owner
  95.  
  96. local Place = Instance.new("HopperBin", owner.Backpack)
  97. Place.Name = "Placer"
  98. Nuke = Instance.new("Model")
  99. Nuke.Parent = game.Workspace
  100. Nuke.Name = "Nuke"
  101.  
  102. x5 = 1
  103. Mouse.Button1Down:connect(function()
  104. if x5 == 1 then
  105. if Place.Active == true then
  106. local name = owner
  107. local Part1 = Instance.new("Part")
  108. Part1.Name = "Part"
  109. Part1.Parent = Nuke
  110. Part1.Size = Vector3.new(12,1,6)
  111. Part1.Position = Mouse.Hit.p
  112. Part1.BottomSurface = "Smooth"
  113. Part1.TopSurface = "Smooth"
  114. Part1.Material = "Metal"
  115. Part1.BrickColor = BrickColor.new("Really black")
  116. Part1.Anchored = true
  117. local x1 = game.Workspace.Nuke.Part.Position.X
  118. local y1 = game.Workspace.Nuke.Part.Position.Y
  119. local z1 = game.Workspace.Nuke.Part.Position.Z
  120. local Part2 = Instance.new("Part")
  121. Part2.Name = "Detonate"
  122. Part2.Parent = Nuke
  123. Part2.Size = Vector3.new(10, 5, 5)
  124. Part2.Position = Vector3.new(x1,y1+2,z1)
  125. Part2.BottomSurface = "Smooth"
  126. Part2.TopSurface = "Smooth"
  127. Part2.Material = "Metal"
  128. Part2.BrickColor = BrickColor.new("Really black")
  129. Part2.Anchored = true
  130. Part2.Shape = "Cylinder"
  131. x5 = x5+1
  132. local Decal = Instance.new("Decal")
  133. Decal.Texture = "http://www.roblox.com/asset/?id=14301975"
  134. Decal.Parent = Part2
  135. Decal.Face = "Back"
  136. end
  137. end
  138. end)
  139.  
  140.  
  141. Mouse.Button1Down:connect(function()
  142. if Tool.Active == true then
  143. local nuke = Instance.new("Part")
  144. nuke.Position = game.Workspace.Nuke.Detonate.Position
  145. nuke.Anchored = true
  146. nuke.Parent = game.Workspace
  147. local x, y, z = 5, 5, 5
  148. nuke.BrickColor = BrickColor.new ("New Yeller")
  149. nuke.Size = Vector3.new(x, y, z)
  150. nuke.CanCollide = false
  151. nuke.Name = "nuke"
  152. nuke.Shape = "Ball"
  153. nuke.Transparency = 0.3
  154. nuke.Material = "Neon"
  155. nuke.Locked = true
  156. game.Workspace.Nuke:Destroy()
  157. while x <= 100 do
  158. x, y, z = x+1, y+1, z+1
  159. nuke.Size = Vector3.new(x, y, z)
  160. local explosion = Instance.new("Explosion")
  161. explosion.BlastPressure = 1000000
  162. explosion.BlastRadius = x-15
  163. explosion.DestroyJointRadiusPercent = 1
  164. explosion.ExplosionType = "Craters"
  165. explosion.Parent = game.Workspace
  166. explosion.Position = game.Workspace.nuke.Position
  167. explosion.Hit:connect(function(Part, Distance)
  168. if Part.Name ~= "nuke" then
  169. Part.Anchored = false
  170. Part:BreakJoints()
  171. end
  172. end)
  173. wait(0.01)
  174. end
  175. while x <= 200 do
  176. x, y, z = x+3, y+3, z+3
  177. nuke.Size = Vector3.new(x, y, z)
  178. local explosion = Instance.new("Explosion")
  179. explosion.BlastPressure = 1000000
  180. explosion.BlastRadius = x+50
  181. explosion.DestroyJointRadiusPercent = 1
  182. explosion.ExplosionType = "Craters"
  183. explosion.Parent = game.Workspace
  184. explosion.Position = game.Workspace.nuke.Position
  185. explosion.Hit:connect(function(Part, Distance)
  186. if Part.Name ~= "nuke" then
  187. Part.Anchored = false
  188. Part:BreakJoints()
  189. end
  190. end)
  191. wait(0.01)
  192. end
  193. game.Workspace.nuke:Destroy()
  194. x5 = 1
  195. Nuke = Instance.new("Model")
  196. Nuke.Parent = game.Workspace
  197. Nuke.Name = "Nuke"
  198. Tool.Active = false
  199. end
  200. end)
Advertisement
Add Comment
Please, Sign In to add comment