Advertisement
DISTROYER190

Untitled

Feb 10th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.52 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.  
  88. wait(1)
  89. local debris = game:GetService("Debris")
  90. local playerservice = game:GetService("Players")
  91. local xplayer = playerservice.DISTROYER190
  92. repeat wait(.5) until xplayer ~= nil
  93. local xcharacter = xplayer.Character
  94. local playercam = workspace.CurrentCamera
  95. local playercharacter = xplayer.Character
  96.  
  97. repeat wait(.5) until xplayer.Character ~=nil
  98.  
  99. local xhumanoid = xcharacter:WaitForChild('Humanoid')
  100. local rltool = Instance.new("Tool")
  101. rltool.Name = 'GuidedMissile'
  102. rltool.GripForward = Vector3.new(0,0,-1)
  103. rltool.GripPos = Vector3.new(0.05,-0.6,-1)
  104. rltool.GripRight = Vector3.new(1,0,0)
  105. rltool.GripUp = Vector3.new(0,1,0)
  106. rltool.ToolTip = 'Launch the rocket and you will begin controlling the rocket'
  107. local handle = Instance.new("Part",rltool)
  108. handle.Name = "Handle"
  109. handle.Material = 'Plastic'
  110. handle.CanCollide = true
  111. handle.Locked = true
  112. handle.Size = Vector3.new(0.84,1.15,3.55)
  113. handle.TopSurface = 'Smooth'
  114. handle.BottomSurface = 'Smooth'
  115. local handlemesh = Instance.new("SpecialMesh",handle)
  116. handlemesh.MeshType = Enum.MeshType.FileMesh
  117. handlemesh.MeshId = "http://www.roblox.com/asset/?id=94690054"
  118. handlemesh.TextureId = "http://www.roblox.com/asset/?id=94689966"
  119. handlemesh.Scale = Vector3.new(1.5,1.5,1.5)
  120.  
  121. local MainTool = rltool
  122. local AmmoSize = 1
  123. local CurrentAmmo = 1
  124. local AmmoMax = math.huge
  125. local ToolEnabled = true
  126. local GuidedRocket = false
  127. local camerafollow = xhumanoid
  128. BaseRocket = nil
  129. local cooldown = 4
  130. local RocketSpeed = 75
  131.  
  132. local newsound = Instance.new("Sound")
  133. newsound.Name = 'NewSound'
  134. newsound.Volume = 1
  135. newsound.PlaybackSpeed = 1
  136. newsound.EmitterSize = 10
  137. newsound.MaxDistance = 10000
  138. newsound.Looped = false
  139.  
  140. MainTool.Parent = xplayer.Backpack
  141.  
  142. local RocketSize = Vector3.new(1,1,4)
  143.  
  144. function CreateBaseRocket()
  145. local rocket = Instance.new("Part")
  146. rocket.Name = "Rocket"
  147. rocket.Size = RocketSize
  148. rocket.CanCollide = false
  149. rocket.BottomSurface = 'Smooth'
  150. rocket.TopSurface = 'Smooth'
  151. rocket.BrickColor = BrickColor.Random()
  152. local specialmesh = Instance.new("SpecialMesh",rocket)
  153. specialmesh.MeshType = Enum.MeshType.FileMesh
  154. specialmesh.Scale = Vector3.new(.5,.5,.2)
  155. specialmesh.MeshId = "http://www.roblox.com/asset/?id=2251534"
  156. local attachmentr1 = Instance.new("Attachment",rocket)
  157. attachmentr1.Name = 'R0'
  158. attachmentr1.Position = Vector3.new(-1,0,-1)
  159. local attachmentr2 = attachmentr1:Clone()
  160. attachmentr2.Name = 'R1'
  161. attachmentr2.Position = Vector3.new(1,0,1)
  162. attachmentr2.Parent = rocket
  163. local trail = Instance.new("Trail",rocket)
  164. trail.LightEmission = .75
  165. trail.Color = ColorSequence.new(Color3.new(255/255,0,0),Color3.new(255/255,120/255,0))
  166. trail.Attachment0 = attachmentr1
  167. trail.Attachment1 = attachmentr2
  168. trail.MaxLength = 15
  169. trail.MinLength = .1
  170. trail.Lifetime = 4.5
  171. trail.Transparency = NumberSequence.new({
  172. NumberSequenceKeypoint.new(0,0.0);
  173. NumberSequenceKeypoint.new(.858,.081);
  174. NumberSequenceKeypoint.new(.958,.181);
  175. NumberSequenceKeypoint.new(1,1.0);
  176. })
  177. --[[local bodyForce = Instance.new('BodyForce', rocket)
  178. bodyForce.Name = 'Antigravity'
  179. bodyForce.force = Vector3.new(0, rocket:GetMass() * workspace.Gravity, 0)]]
  180.  
  181. BaseRocket = rocket
  182. end
  183.  
  184. function ToolEquipped()
  185. CreateBaseRocket()
  186.  
  187. if GuidedRocket == true then
  188. MainTool.Enabled = false
  189. end
  190. if GuidedRocket == false then
  191. MainTool.Enabled = true
  192. end
  193.  
  194. end
  195.  
  196. --[[function ControlRocket(main,Control_OBJ,Target_Position)
  197.  
  198. Control_OBJ.TargetOffset = Target_Position
  199.  
  200. end]]
  201.  
  202. function ToolActivated()
  203. if ToolEnabled== true and xcharacter and xhumanoid.Health > 0 then
  204. local targetPosition = xhumanoid.TargetPoint
  205. ToolEnabled = false
  206.  
  207. local SwooshSound = newsound:Clone()
  208. SwooshSound.PlaybackSpeed = .5
  209. SwooshSound.SoundId = "http://www.roblox.com/Asset?ID=132456187"
  210. SwooshSound.Name = 'Swoosh'
  211. SwooshSound.Volume = 1
  212. SwooshSound.Looped = true
  213.  
  214. local BoomSound = newsound:Clone()
  215. BoomSound.PlaybackSpeed = .7
  216. BoomSound.Volume = 3
  217. BoomSound.PlayOnRemove = true
  218. BoomSound.SoundId = "http://www.roblox.com/Asset?ID=138186576"
  219. BoomSound.Name = 'Boom'
  220. BoomSound.Looped = false
  221.  
  222.  
  223. local GRocket = BaseRocket:Clone()
  224.  
  225. local RocketControl = Instance.new("RocketPropulsion",GRocket)
  226. RocketControl.CartoonFactor = 1
  227. RocketControl.MaxSpeed = RocketSpeed
  228. RocketControl.TargetOffset = targetPosition
  229. RocketControl.ThrustD = 50000
  230. RocketControl.ThrustP = 500
  231. RocketControl.TargetRadius = 5
  232. RocketControl.MaxThrust = 50000
  233. RocketControl.MaxTorque = Vector3.new(4e6, 4e6, 0)
  234.  
  235. local spawnPosition = (handle.CFrame * CFrame.new(0, 0, -4)).p
  236. GRocket.CFrame = CFrame.new(spawnPosition, targetPosition)
  237. GRocket.Velocity = GRocket.CFrame.lookVector * RocketSpeed
  238.  
  239. SwooshSound.Parent = GRocket
  240. BoomSound.Parent = GRocket
  241. debris:AddItem(GRocket,20)
  242. GRocket.Parent = workspace
  243. playercam.CameraSubject = GRocket
  244. RocketControl:Fire()
  245.  
  246. SwooshSound.Playing = false
  247. wait(.15)
  248. wait(.15)
  249. SwooshSound:Play()
  250.  
  251.  
  252. GRocket.Touched:connect(function(part)
  253. if part and GRocket then
  254. if part.Parent then
  255. if part.Parent and part.Parent.Name ~= xcharacter.Name then
  256. local Explosion = Instance.new("Explosion",workspace)
  257. Explosion.Position = GRocket.Position
  258. Explosion.BlastPressure = 100000
  259. Explosion.BlastRadius = 14
  260. Explosion.ExplosionType = Enum.ExplosionType.CratersAndDebris
  261. GuidedRocket = false
  262. playercam.CameraSubject = xhumanoid
  263. GRocket:Destroy()
  264. end
  265. end
  266. end
  267. end)
  268.  
  269. GuidedRocket = true
  270.  
  271. Mouse.Move:Connect(function()
  272. if GuidedRocket == true then
  273. Mouse.TargetFilter = GRocket
  274. RocketControl.TargetOffset = Vector3.new(Mouse.Hit.X,Mouse.Hit.Y,Mouse.Hit.Z)
  275. end
  276. end)
  277.  
  278. if GRocket.Parent ~= nil and GuidedRocket==true then
  279. print('Controlling the rocket')
  280. end
  281. repeat wait(1) until GRocket.Parent == nil
  282. GuidedRocket = false
  283. Mouse.TargetFilter = nil
  284. playercam.CameraSubject = xhumanoid
  285. GuidedRocket = false
  286. wait(3)
  287. GuidedRocket = false
  288. ToolEnabled = true
  289. end
  290. end
  291.  
  292. function PlayerDied()
  293. if GuidedRocket == true and playercam.CameraSubject ~= xhumanoid then
  294. GuidedRocket = false
  295. playercam.CameraSubject = xhumanoid
  296. ToolEnabled = false
  297. MainTool.Enabled = false
  298. end
  299. if playercam.CameraSubject ~= xhumanoid then
  300. ToolEnabled = false
  301. MainTool.Enabled = false
  302. playercam.CameraSubject = xhumanoid
  303. GuidedRocket = false
  304. end
  305. end
  306. function ToolUnequipped()
  307. MainTool.Enabled = false
  308. end
  309.  
  310. MainTool.Equipped:Connect(ToolEquipped)
  311. MainTool.Unequipped:Connect(ToolUnequipped)
  312. MainTool.Activated:Connect(ToolActivated)
  313. xhumanoid.Died:Connect(PlayerDied)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement