Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- hey so i edited this 9/11 plane script a bit so it works alot better but there are controls for the plane
- W - forward movement (obviously)
- S - backwards movement (obviously)
- U - upwards movement
- Q - downwards movement
- B - drop a bomb
- --]]
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- -- by fr34ky;
- local char = owner.Character
- moveforwardenabled = false
- moveupenabled = false
- movedownenabled = false
- movebackwardsenabled = false
- local player = owner
- repeat wait() until player.Character.Humanoid
- local humanoid = player.Character.Humanoid
- local mouse = player:GetMouse()
- local weld = Instance.new("Weld",char.Torso)
- weld.Part0 = char.Torso
- local pf = Instance.new("ForceField")
- pf.Parent = game.Players.LocalPlayer.Character
- for i,v in pairs(char.Torso:GetChildren()) do
- if v.ClassName == 'Decal' then
- v:Destroy()
- end
- end
- for i,v in pairs(char:GetChildren()) do
- if v.ClassName == 'Accessory' then
- v:Destroy()
- end
- end
- for i,v in pairs(char.Head:GetChildren()) do
- if v.ClassName == 'Decal' then
- v:Destroy()
- end
- end
- char.Humanoid.JumpPower = 200
- char.Humanoid.Jump = true
- local plane = Instance.new('SpecialMesh', char.Torso)
- plane.MeshType = 'FileMesh'
- plane.MeshId = 'http://www.roblox.com/asset/?id=4791163583'
- plane.TextureId = 'http://www.roblox.com/asset/?id=4791164454'
- plane.Scale = Vector3.new(3, 3, 3)
- planesound=Instance.new('Sound', char.Torso)
- planesound.SoundId = 'rbxassetid://439771510'
- --planesound.Volume = 1
- planesound.Looped = true
- pullup=Instance.new('Sound', char.Torso)
- pullup.SoundId = 'rbxassetid://144560522'
- pullup.Volume = 10
- pullup.Looped = true
- alarm=Instance.new('Sound', char.Torso)
- alarm.SoundId = 'rbxassetid://384231761'
- alarm.Volume = 10
- alarm.Looped = true
- screech=Instance.new('Sound', char.Torso)
- screech.SoundId = 'rbxassetid://262353320'
- screech.Volume = 10
- st=Instance.new('Sound', char.Torso)
- st.SoundId = 'rbxassetid://131353021'
- st.Volume = 20
- allahuakbar=Instance.new('Sound', char)
- allahuakbar.SoundId = 'rbxassetid://293292782'
- allahuakbar.Volume = 10
- moosic=Instance.new('Sound', char)
- moosic.SoundId = 'rbxassetid://165969964'
- moosic.Volume = 2
- allahuakbar2=Instance.new('Sound', char)
- allahuakbar2.SoundId = 'rbxassetid://446824013' --446824013
- allahuakbar2.Volume = 1
- planesound:Play()
- explosionf=Instance.new('ParticleEmitter', char.Torso)
- explosionf.Texture = 'http://www.roblox.com/asset/?id=244514357'
- explosionf.Size = NumberSequence.new(19)
- explosionf.Rate = 1000
- explosionf.LightEmission = 0.4
- explosionf.Lifetime = NumberRange.new(1)
- explosionf.VelocitySpread = 360
- explosionf.Enabled = false
- char.Head.Transparency = 1
- char['Left Arm'].Transparency = 1
- char['Right Arm'].Transparency = 1
- char['Left Leg'].Transparency = 1
- char['Right Leg'].Transparency = 1
- 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
- local Me = game:GetService("Players").LocalPlayer
- local Char = Me.Character
- local Mouse = Me:GetMouse()
- local Cam = Workspace.CurrentCamera
- local Stop = false
- local Version = 0
- local MaxSpeed = 8
- local Speed = 8
- local Keys = {}
- local Force = 10000 -- 10000 = Fly, 1000000 = Noclip
- game:GetService("RunService").RenderStepped:connect(function()
- if humanoid.Health > 0 then
- end
- end)
- NLS([[
- -- Created By FormerPocketLegender. Place in starterpack! This is a local script, so it won't work anywhere else :D
- -- Go to line 57 to modify the hotkey to stop flying and to start flying again. I already set "e" to default, you can change it if you want.
- -- Credit by a screen text gui or in game description is appreciated, or else I'll become sad ;(
- repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
- local mouse = game.Players.LocalPlayer:GetMouse()
- repeat wait() until mouse
- local plr = game.Players.LocalPlayer
- local torso = plr.Character.Torso
- local flying = true
- local deb = true
- local ctrl = {f = 0, b = 0, l = 0, r = 0}
- local lastctrl = {f = 0, b = 0, l = 0, r = 0}
- local maxspeed = 200
- local speed = 0
- function Fly()
- local bg = Instance.new("BodyGyro", torso)
- bg.P = 9e4
- bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
- bg.cframe = torso.CFrame
- local bv = Instance.new("BodyVelocity", torso)
- bv.velocity = Vector3.new(0,0.1,0)
- bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
- repeat wait()
- plr.Character.Humanoid.PlatformStand = true
- if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
- speed = speed+5+(speed/maxspeed)
- if speed > maxspeed then
- speed = maxspeed
- end
- elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
- speed = speed-1
- if speed < 0 then
- speed = 0
- end
- end
- if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
- bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
- lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
- elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
- bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
- else
- bv.velocity = Vector3.new(0,0.1,0)
- end
- bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*0*speed/maxspeed),0,0)
- until not flying
- ctrl = {f = 0, b = 0, l = 0, r = 0}
- lastctrl = {f = 0, b = 0, l = 0, r = 0}
- speed = 0
- bg:Destroy()
- bv:Destroy()
- plr.Character.Humanoid.PlatformStand = false
- end
- mouse.KeyDown:connect(function(key)
- if key:lower() == "f" then
- if flying then flying = false
- else
- flying = true
- Fly()
- end
- elseif key:lower() == "w" then
- ctrl.f = 1
- elseif key:lower() == "s" then
- ctrl.b = -1
- elseif key:lower() == "a" then
- ctrl.l = -1
- elseif key:lower() == "d" then
- ctrl.r = 1
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key:lower() == "w" then
- ctrl.f = 0
- elseif key:lower() == "s" then
- ctrl.b = 0
- elseif key:lower() == "a" then
- ctrl.l = 0
- elseif key:lower() == "d" then
- ctrl.r = 0
- end
- end)
- Fly()
- ]],char)
- mouse.KeyDown:connect(function(key)
- if key == "b" then
- bomb = Instance.new("Part",workspace)
- bomb.Name = "PlaneBomb"
- bomb.Position = char.Torso.Position - Vector3.new(0,5,0)
- bomb.Size = Vector3.new(4,4,4)
- bomb.Touched:connect(function(part)
- if part.Parent ~= char then
- local Explosion = Instance.new("Explosion",workspace)
- Explosion.Position = bomb.Position
- Explosion.BlastPressure = 100000
- Explosion.DestroyJointRadiusPercent = 0.7
- Explosion.ExplosionType = "CratersAndDebris"
- Explosion.BlastRadius = 50
- Explosion.Hit:connect(function(Hit, Distance)
- if Hit.Parent ~= char then
- Hit.Anchored = false
- Hit:BreakJoints()
- end
- end)
- end
- end)
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key == "w" then
- moveforwardenabled = false
- end
- end)
- mouse.KeyDown:connect(function(key)
- if key == "c" then
- planesound:Stop()
- screech:Play()
- allahuakbar2:Stop()
- pullup:Stop()
- explosionf.Enabled = false
- alarm:Stop()
- local e = Instance.new("Smoke", char.Torso)
- e.Size = 20
- char.Torso.Anchored = false
- wait(3)
- e.Enabled = false
- end
- end)
- Enabled = false
- function onTouched(hit)
- if hit.Name ~= "PlaneBomb" and Enabled == false then
- Enabled=true
- local e = Instance.new("Explosion")
- e.BlastRadius = 260-- How much ground the explosion covers --
- e.BlastPressure = 51-- How powerful the explosion is --
- e.Parent = workspace -- Don't change this!
- e.Position = char.HumanoidRootPart.Position -- Don't change this!
- e.Hit:Connect(function(part)
- part.Anchored = false
- part:BreakJoints()
- fire = Instance.new("Fire",part)
- part.BrickColor = BrickColor.new("Really black")
- coroutine.resume(coroutine.create(function()
- wait(3)
- part:remove()
- end))
- end)
- allahuakbar:Play()
- explosionf.Size = NumberSequence.new(50)
- explosionf.Speed = NumberRange.new(30)
- explosionf.Enabled = true
- char.Torso.Anchored = true
- explosionf.Lifetime = NumberRange.new(0.25)
- allahuakbar2:Play()
- allahuakbar2.Pitch = 0
- pullup:Stop()
- alarm:Stop()
- moosic:Play()
- plane.TextureId = "rbxassetid://2675785344"
- wait(1.25)
- allahuakbar2.Pitch = 0
- explosionf.Enabled = false
- planesound:Stop()
- wait(0.50)
- plr = owner.Name
- for i,v in pairs(game.Players:GetChildren()) do
- if v.Name ~= plr then
- game:GetService("Chat"):Chat(v.Character.Head, "ALLAHU AKBAR!! HEIL PLANE CRASHES!", Enum.ChatColor.Blue)
- AKBAR=Instance.new('Sound', v.Character.Head)
- AKBAR.SoundId = 'rbxassetid://707769915'
- AKBAR.Volume = 15
- AKBAR.Pitch = 1
- AKBAR.Looped = false
- AKBAR:Play()
- wait(2.6)
- AKBAR:Play()
- end
- end
- end
- end
- char.HumanoidRootPart.Touched:connect(onTouched)
Add Comment
Please, Sign In to add comment