Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Fly Car (Prison Life)
- -- Instances:
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local Fly = Instance.new("TextButton")
- local Text = Instance.new("TextLabel")
- local TextLabel = Instance.new("TextLabel")
- local TextLabel_2 = Instance.new("TextLabel")
- --Properties:
- ScreenGui.Parent = game.CoreGui
- ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame.Parent = ScreenGui
- Frame.BackgroundColor3 = Color3.fromRGB(0, 154, 0)
- Frame.Position = UDim2.new(0.734463215, 0, 0.204301089, 0)
- Frame.Size = UDim2.new(0, 218, 0, 247)
- Frame.Active = true
- Frame.Draggable = true
- Fly.Name = "Fly"
- Fly.Parent = Frame
- Fly.BackgroundColor3 = Color3.fromRGB(0, 179, 179)
- Fly.BorderSizePixel = 0
- Fly.Position = UDim2.new(0.0871559605, 0, 0.542510092, 0)
- Fly.Size = UDim2.new(0, 179, 0, 50)
- Fly.Font = Enum.Font.SourceSans
- Fly.Text = "Press to execute fly car"
- Fly.TextColor3 = Color3.fromRGB(0, 0, 0)
- Fly.TextSize = 14.000
- Fly.MouseButton1Down:connect(function()
- local hint = Instance.new("Hint",game.Players.LocalPlayer.PlayerGui)
- hint.Text = "Press Z To Toggle"
- hint.Name = game.JobId
- 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 = 500
- 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 = false
- if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
- speed = speed+125.0+(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-250
- 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)*50*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() == "z" 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
- wait(5)
- hint:Destroy()
- end)
- Fly()
- end)
- Text.Name = "Text"
- Text.Parent = Frame
- Text.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- Text.Size = UDim2.new(0, 218, 0, 32)
- Text.Font = Enum.Font.SourceSans
- Text.Text = "Prison Life Fly Car Script"
- Text.TextColor3 = Color3.fromRGB(0, 0, 0)
- Text.TextSize = 14.000
- TextLabel.Parent = Frame
- TextLabel.BackgroundColor3 = Color3.fromRGB(0, 154, 0)
- TextLabel.BorderSizePixel = 0
- TextLabel.Position = UDim2.new(0.087155968, 0, 0.182186231, 0)
- TextLabel.Size = UDim2.new(0, 174, 0, 89)
- TextLabel.Font = Enum.Font.SourceSans
- TextLabel.Text = "TO UNFLY PRESS 'Z' TO FLY PRESS 'Z'"
- TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel.TextSize = 14.000
- TextLabel_2.Parent = Frame
- TextLabel_2.BackgroundColor3 = Color3.fromRGB(0, 170, 0)
- TextLabel_2.Position = UDim2.new(0, 0, 1, 0)
- TextLabel_2.Size = UDim2.new(0, 218, 0, 50)
- TextLabel_2.Font = Enum.Font.SourceSans
- TextLabel_2.Text = "Credits: Birthday"
- TextLabel_2.TextColor3 = Color3.fromRGB(0, 0, 0)
- TextLabel_2.TextSize = 14.000
Advertisement
Advertisement