Advertisement
DarkScriptZEditors

Plane

Dec 21st, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.68 KB | None | 0 0
  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,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  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.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. -- by fr34ky;
  137. local char = game.Players.LocalPlayer.Character
  138.  
  139.  
  140. local player = game.Players.LocalPlayer
  141. repeat wait() until player.Character.Humanoid
  142. local humanoid = player.Character.Humanoid
  143. local mouse = player:GetMouse()
  144.  
  145. local weld = Instance.new("Weld",char.Torso)
  146. weld.Part0 = char.Torso
  147.  
  148. local plane = Instance.new("Part",char.Torso)
  149. plane.Anchored = false
  150. plane.CanCollide = false
  151. plane.Size = Vector3.new(3,2,6)
  152. plane.CustomPhysicalProperties = PhysicalProperties.new(0,0,0,0,0)
  153. weld.Part1 = plane
  154. weld.C1 = CFrame.new(0,0.5,0) * CFrame.Angles(0,math.rad(270),0)
  155.  
  156. local pf = Instance.new("ForceField")
  157. pf.Parent = game.Players.LocalPlayer.Character
  158.  
  159. for i,v in pairs(char.Torso:GetChildren()) do
  160. if v.ClassName == 'Decal' then
  161. v:Destroy()
  162. end
  163. end
  164. for i,v in pairs(char:GetChildren()) do
  165. if v.ClassName == 'Hat' then
  166. v:Destroy()
  167. end
  168. end
  169. for i,v in pairs(char.Head:GetChildren()) do
  170. if v.ClassName == 'Decal' then
  171. v:Destroy()
  172. end
  173. end
  174.  
  175. char.Humanoid.JumpPower = 200
  176. char.Humanoid.Jump = true
  177.  
  178. local plane = Instance.new('SpecialMesh', plane)
  179. plane.MeshType = 'FileMesh'
  180. plane.MeshId = 'http://www.roblox.com/asset/?id=498194022' --498194022
  181. plane.TextureId = 'http://www.roblox.com/asset/?id=498194025'
  182. plane.Scale = Vector3.new(0.2, 0.2, 0.2)
  183.  
  184.  
  185. planesound=Instance.new('Sound', char.Torso)
  186. planesound.SoundId = 'rbxassetid://439771510'
  187. planesound.Volume = 1
  188. planesound.Looped = true
  189.  
  190. pullup=Instance.new('Sound', char.Torso)
  191. pullup.SoundId = 'rbxassetid://144560522'
  192. pullup.Volume = 10
  193. pullup.Looped = true
  194.  
  195. alarm=Instance.new('Sound', char.Torso)
  196. alarm.SoundId = 'rbxassetid://384231761'
  197. alarm.Volume = 10
  198. alarm.Looped = true
  199.  
  200.  
  201. screech=Instance.new('Sound', char.Torso)
  202. screech.SoundId = 'rbxassetid://262353320'
  203. screech.Volume = 10
  204.  
  205. st=Instance.new('Sound', char.Torso)
  206. st.SoundId = 'rbxassetid://131353021'
  207. st.Volume = 20
  208.  
  209. allahuakbar=Instance.new('Sound', char)
  210. allahuakbar.SoundId = 'rbxassetid://293292782'
  211. allahuakbar.Volume = 10
  212.  
  213. moosic=Instance.new('Sound', char)
  214. moosic.SoundId = 'rbxassetid://504630746'
  215. moosic.Volume = 2
  216.  
  217. allahuakbar2=Instance.new('Sound', char)
  218. allahuakbar2.SoundId = 'rbxassetid://446824013' --446824013
  219. allahuakbar2.Volume = 1
  220.  
  221.  
  222. planesound:Play()
  223.  
  224. explosionf=Instance.new('ParticleEmitter', char.Torso)
  225. explosionf.Texture = 'http://www.roblox.com/asset/?id=244514357'
  226. explosionf.Size = NumberSequence.new(19)
  227. explosionf.Rate = 1000
  228. explosionf.LightEmission = 0.4
  229. explosionf.Lifetime = NumberRange.new(1)
  230. explosionf.VelocitySpread = 360
  231. explosionf.Enabled = false
  232.  
  233.  
  234.  
  235. char.Torso.Transparency = 1
  236. char.Head.Transparency = 1
  237. char['Left Arm'].Transparency = 1
  238. char['Right Arm'].Transparency = 1
  239. char['Left Leg'].Transparency = 1
  240. char['Right Leg'].Transparency = 1
  241.  
  242. repeat wait(1)until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:GetMouse() and game:FindService("Workspace") and game.Workspace.CurrentCamera
  243. local Me = game:GetService("Players").LocalPlayer
  244. local Char = Me.Character
  245. local Mouse = Me:GetMouse()
  246. local Cam = Workspace.CurrentCamera
  247. local Stop = false
  248. local Version = 0
  249. local MaxSpeed = 8
  250. local Speed = 8
  251. local Keys = {}
  252. local Force = 10000 -- 10000 = Fly, 1000000 = Noclip
  253.  
  254. local Fly, Rot = Char.Torso:FindFirstChild("LMMFly"), Char.Torso:FindFirstChild("LMMRot")
  255. if Fly then Fly:Destroy() end if Rot then Rot:Destroy() end
  256. Fly = Instance.new("BodyPosition", Char.Torso) Fly.Name = "LMMFly" Fly.maxForce = Vector3.new(math.huge, math.huge, math.huge) Fly.P = Force Fly.position = Char.Torso.Position
  257. Rot = Instance.new("BodyGyro", Char.Torso) Rot.Name = "LMMRot" Rot.maxTorque = Vector3.new(math.huge, math.huge, math.huge) Rot.P = Force Rot.cframe = Cam.CoordinateFrame
  258.  
  259. local Thread,Old = Version, nil
  260. Char.Humanoid.PlatformStand = true
  261.  
  262. function StopFly()
  263. Version = Version + 1 Stop = true Char.Humanoid.PlatformStand = false Fly:Destroy() Rot:Destroy() script.Disabled = true script:Destroy()
  264. end
  265.  
  266. Char.ChildAdded:connect(function(Obj) wait()
  267. if Obj.Name == "LM".."MFlyStop" then
  268. Obj:Destroy()
  269. StopFly()
  270. end
  271. end)
  272.  
  273. coroutine.wrap(function() while Thread == Version and Stop == false do
  274. local Vectoring = Rot.cframe - Rot.cframe.p + Fly.position
  275.  
  276. if Keys[string.char(48)] then Speed = 1 end
  277. if Keys.w then Vectoring = Vectoring + Cam.CoordinateFrame.lookVector * Speed end
  278. if Keys.s then Vectoring = Vectoring - Cam.CoordinateFrame.lookVector * Speed end
  279. if Keys.d then Vectoring = Vectoring * CFrame.new(Speed,0,0) end
  280. if Keys.a then Vectoring = Vectoring * CFrame.new(-Speed,0,0) end
  281. if Keys.e or Keys[" "] then Vectoring = Vectoring * CFrame.new(0,Speed,0) end
  282. if Keys.q then Vectoring = Vectoring * CFrame.new(0,-Speed,0) end
  283. if Keys.x then StopFly() end
  284.  
  285. if Old ~= Vectoring then
  286. Fly.position = Vectoring.p
  287. Old = Vectoring
  288. Speed = math.min(Speed + Speed*0.025,MaxSpeed)
  289. else
  290. Speed = 1;
  291. end
  292. Rot.cframe = Cam.CoordinateFrame
  293. wait(0.01)
  294. end end)()
  295.  
  296. Mouse.KeyDown:connect(function(Key)
  297. Keys[Key] = true
  298. end)
  299. Mouse.KeyUp:connect(function(Key)
  300. Keys[Key] = false
  301. end)
  302.  
  303.  
  304. mouse.KeyDown:connect(function(key)
  305. if key == "c" then
  306. planesound:Stop()
  307. screech:Play()
  308. allahuakbar2:Stop()
  309. pullup:Stop()
  310. explosionf.Enabled = false
  311. alarm:Stop()
  312. local e = Instance.new("Smoke", char.Torso)
  313. e.Size = 20
  314. char.Torso.Anchored = false
  315. wait(3)
  316. e.Enabled = false
  317.  
  318. end
  319. end)
  320.  
  321. mouse.KeyDown:connect(function(key)
  322. if key == "v" then
  323. explosionf.Enabled = true
  324. pullup:Play()
  325. alarm:Play()
  326. explosionf.Size = NumberSequence.new(5)
  327. end
  328. end)
  329.  
  330. mouse.KeyDown:connect(function(key)
  331. if key == "b" then
  332. moosic:Play()
  333. end
  334. end)
  335.  
  336. mouse.KeyDown:connect(function(key)
  337. if key == "n" then
  338. moosic:Stop()
  339. end
  340. end)
  341.  
  342. mouse.KeyDown:connect(function(key)
  343. if key == "z" then
  344. planesound:Play()
  345. screech:Stop()
  346. char.Torso.Anchored = false
  347. st:Play()
  348. allahuakbar2:Stop()
  349. pullup:Stop()
  350. explosionf.Enabled = false
  351. alarm:Stop()
  352.  
  353.  
  354. end
  355. end)
  356.  
  357. Enabled = false
  358. function onTouched(hit)
  359. if Enabled then
  360. return
  361. end
  362. Enabled=false
  363. local e = Instance.new("Explosion")
  364. e.BlastRadius = 260-- How much ground the explosion covers --
  365. e.BlastPressure = 51-- How powerful the explosion is --
  366. e.Parent = char.Torso -- Don't change this!
  367. e.Position = char.Torso.Position -- Don't change this!
  368. allahuakbar:Play()
  369. explosionf.Size = NumberSequence.new(50)
  370. explosionf.Speed = NumberRange.new(30)
  371. explosionf.Enabled = true
  372. char.Torso.Anchored = true
  373. explosionf.Lifetime = NumberRange.new(0.25)
  374. allahuakbar2:Play()
  375. allahuakbar2.Pitch = 0
  376. pullup:Stop()
  377. alarm:Stop()
  378. wait(1.25)
  379. allahuakbar2.Pitch = 0
  380. explosionf.Enabled = false
  381. planesound:Stop()
  382. wait(0.50)
  383. plr = game.Players.LocalPlayer.Name
  384. for i,v in pairs(game.Players:GetChildren()) do
  385. if v.Name ~= plr then
  386. game:GetService("Chat"):Chat(v.Character.Head, "ALLAHU AKBAR!! HEIL PLANE CRASHES!", Enum.ChatColor.Blue)
  387. AKBAR=Instance.new('Sound', v.Character.Head)
  388. AKBAR.SoundId = 'rbxassetid://396873260'
  389. AKBAR.Volume = 15
  390. AKBAR.Pitch = 0.25
  391. AKBAR.Looped = false
  392. AKBAR:Play()
  393. wait(2.6)
  394. AKBAR:Play()
  395.  
  396. end
  397. end
  398.  
  399. end
  400. char.Torso.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement