hecknes

Nuke

Jul 9th, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. --thank you for bringing this paste 1k views! :)
  2.  
  3.  
  4.  
  5. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  6. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  7. do
  8. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  9. script.Parent = Player.Character
  10.  
  11. --RemoteEvent for communicating
  12. local Event = Instance.new("RemoteEvent")
  13. Event.Name = "UserInput_Event"
  14.  
  15. --Fake event to make stuff like Mouse.KeyDown work
  16. local function fakeEvent()
  17. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  18. t.connect = t.Connect
  19. return t
  20. end
  21.  
  22. --Creating fake input objects with fake variables
  23. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  24. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  25. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  26. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  27. end}
  28. --Merged 2 functions into one by checking amount of arguments
  29. CAS.UnbindAction = CAS.BindAction
  30.  
  31. --This function will trigger the events that have been :Connect()'ed
  32. local function te(self,ev,...)
  33. local t = m[ev]
  34. if t and t._fakeEvent and t.Function then
  35. t.Function(...)
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=Player then return end
  43. if io.isMouse then
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. else
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. for _,t in pairs(CAS.Actions) do
  52. for _,k in pairs(t.Keys) do
  53. if k==io.KeyCode then
  54. t.Function(t.Name,io.UserInputState,io)
  55. end
  56. end
  57. end
  58. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  59. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  60. end
  61. end)
  62. Event.Parent = NLS([==[
  63. local Player = game:GetService("Players").LocalPlayer
  64. local Event = script:WaitForChild("UserInput_Event")
  65.  
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local Mouse = Player:GetMouse()
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  86. end
  87.  
  88. hint = Instance.new("Hint",workspace)
  89. nuke = Instance.new("Part",workspace)
  90. nuke.Size = Vector3.new(5,50,5)
  91. nuke.Material = Enum.Material.DiamondPlate
  92. nuke.BrickColor = BrickColor.Gray()
  93. nuke.CFrame = CFrame.new(0,10000,0)
  94. bodypos = Instance.new("BodyPosition",nuke)
  95. bodypos.MaxForce = Vector3.new(100,100,100)
  96. bodypos.D = 100
  97. bodypos.P = 5
  98. bodypos.Position = Vector3.new(0,0,0)
  99. debounce = false
  100. size = 5
  101. waittime = 0.0001
  102. hint.Text = "TACTICAL NUKE! INCOMING!"
  103. nuke.Touched:connect(function()
  104. if debounce == false then
  105. debounce = true
  106. nuke.Anchored = true
  107. boomboom = Instance.new("Part",workspace)
  108. boomboom.BrickColor = BrickColor.new("Gold")
  109. boomboom.Shape = Enum.PartType.Ball
  110. boomboom.Anchored = true
  111. boomboom.Transparency = 0.5
  112. boomboom.TopSurface = Enum.SurfaceType.Smooth
  113. boomboom.BottomSurface = Enum.SurfaceType.Smooth
  114. boomboom.CanCollide = false
  115. boomboom.CFrame = CFrame.new(0,0,0)
  116. boomboom.Touched:connect(function(hit)
  117. hit:BreakJoints()
  118. end)
  119. while true do
  120. wait(waittime)
  121. expl = Instance.new("Explosion",workspace)
  122. hint.Text = "NUKE HAS GAINED "..tostring(boomboom.Size.Y).." STUDS OF SIZE!"
  123. expl.BlastPressure = 999
  124. expl.BlastRadius = size
  125. expl.Position = Vector3.new(0,0,0)
  126. boomboom.Size = boomboom.Size + Vector3.new(size,size,size)
  127. size = size + 0.001
  128. waittime = waittime - 0.001
  129. end
  130. end
  131. end)
Advertisement
Add Comment
Please, Sign In to add comment