What's new
Heapleak - Scripthub

Get the most out of HeapLeak by creating a free account! Once signed in, you’ll gain full access to restricted content, be able to share your own scripts, and participate in our member-only discussions.

Jetpack Script

Version / Update: v1.0.0
Download / Script Link
--// SERVICES
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")

local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local root = char:WaitForChild("HumanoidRootPart")
local torso = char:FindFirstChild("UpperTorso") or char:FindFirstChild("Torso")

--// STATES
local flying = false
local safe = false
local fireSafe = false
local wasFlying = false
local bodyVel = nil

--// DAMAGE PROTECTION
humanoid.HealthChanged:Connect(function()
if safe or fireSafe then
if humanoid.Health < humanoid.MaxHealth then
humanoid.Health = humanoid.MaxHealth
end
end
end)

--// JETPACK MODEL
local jetpack = Instance.new("Model", char)
jetpack.Name = "Jetpack"

local function makePart(size, color, material, name)
local p = Instance.new("Part")
p.Size = size
p.Color = color
p.Material = material
p.Name = name
p.CanCollide = false
p.Parent = jetpack
return p
end

local center = makePart(Vector3.new(2,2,1), Color3.fromRGB(120,120,120), Enum.Material.DiamondPlate, "Core")
local left = makePart(Vector3.new(0.8,2,0.8), Color3.fromRGB(30,30,30), Enum.Material.DiamondPlate, "LeftBooster")
local right = makePart(Vector3.new(0.8,2,0.8), Color3.fromRGB(30,30,30), Enum.Material.DiamondPlate, "RightBooster")

--// WELD TO TORSO
local function weld(part, offset)
part.CFrame = torso.CFrame * offset
local w = Instance.new("WeldConstraint")
w.Part0 = part
w.Part1 = torso
w.Parent = part
end

weld(center, CFrame.new(0,0,1.5))
weld(left, CFrame.new(-1.5,0,1.5))
weld(right, CFrame.new(1.5,0,1.5))

--// FIRE
local function addFire(part)
local fire = Instance.new("Fire")
fire.Size = 5
fire.Heat = 10
fire.Enabled = false
fire.Parent = part
return fire
end

local fireL = addFire(left)
local fireR = addFire(right)

--// SOUNDS
local thrustSound = Instance.new("Sound")
thrustSound.SoundId = "rbxassetid://126005836440121"
thrustSound.Volume = 1
thrustSound.Looped = true
thrustSound.Parent = root

local flySound = Instance.new("Sound")
flySound.SoundId = "rbxassetid://75071452214244"
flySound.Volume = 1
flySound.Looped = true
flySound.Parent = root

--// FIRE DETECTION
local function isFire(part)
if not part then return false end
local name = part.Name:lower()
return name:find("lava") or name:find("fire") or part.Material == Enum.Material.Neon
end

root.Touched:Connect(function(hit)
if flying and isFire(hit) then
fireSafe = true
end
end)

root.TouchEnded:Connect(function(hit)
if isFire(hit) then
fireSafe = false
end
end)

--// FLIGHT LOOP
RunService.RenderStepped:Connect(function()
if flying and bodyVel then
local cam = workspace.CurrentCamera
bodyVel.Velocity = cam.CFrame.LookVector * 80 + Vector3.new(0,50,0)
flySound.PlaybackSpeed = math.clamp(bodyVel.Velocity.Magnitude / 100, 0.8, 2)
end

-- SMART FALL DAMAGE
if wasFlying then
local state = humanoid:GetState()
if state == Enum.HumanoidStateType.Freefall then
safe = true
end
if state == Enum.HumanoidStateType.Landed or state == Enum.HumanoidStateType.Running then
safe = false
wasFlying = false
end
end
end)

--// START FLY
local function startFly()
if flying then return end
flying = true
wasFlying = true
safe = true
bodyVel = Instance.new("BodyVelocity")
bodyVel.MaxForce = Vector3.new(1e9,1e9,1e9)
bodyVel.Parent = root
fireL.Enabled = true
fireR.Enabled = true
thrustSound:Play()
flySound:Play()
end

--// STOP FLY
local function stopFly()
if not flying then return end
flying = false
if bodyVel then bodyVel:Destroy() bodyVel=nil end
fireL.Enabled = false
fireR.Enabled = false
thrustSound:Stop()
flySound:Stop()
end

--// INPUT
UserInputService.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.J then startFly() end
end)

UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.J then stopFly() end
end)

--==================--
--// GUI + SKINS
--==================--

local screenGui = Instance.new("ScreenGui", game.CoreGui)
screenGui.Name = "JetpackSkinGUI"

-- draggable container
local mainButton = Instance.new("ImageButton")
mainButton.Size = UDim2.new(0,60,0,60)
mainButton.Position = UDim2.new(0.8,0,0.05,0)
mainButton.BackgroundColor3 = Color3.fromRGB(255,255,255)
mainButton.Image = "" -- empty for squircle look
mainButton.AutoButtonColor = true
mainButton.Parent = screenGui
mainButton.Draggable = true
mainButton.Modal = true

local listFrame = Instance.new("Frame")
listFrame.Size = UDim2.new(0,150,0,150)
listFrame.Position = UDim2.new(0,0,1,10)
listFrame.BackgroundColor3 = Color3.fromRGB(40,40,40)
listFrame.Visible = false
listFrame.Parent = mainButton

-- SKINS
local skins = {
{Name="Default", Core=Color3.fromRGB(120,120,120), Side=Color3.fromRGB(120,120,120), Decal=nil},
{Name="Bluesteel", Core=Color3.fromRGB(135,206,250), Side=Color3.fromRGB(0,0,139), Decal=nil},
{Name="ALL WHITE", Core=Color3.fromRGB(255,255,255), Side=Color3.fromRGB(255,255,255), Decal=178882473}
}

-- create buttons
local y = 10
for i, skin in pairs(skins) do
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1,-10,0,30)
btn.Position = UDim2.new(0,5,0,y)
btn.BackgroundColor3 = Color3.fromRGB(80,80,80)
btn.Text = skin.Name
btn.Parent = listFrame

btn.MouseButton1Click:Connect(function()
-- apply skin
center.Color = skin.Core
left.Color = skin.Side
right.Color = skin.Side

-- add decal if needed
for _, part in pairs({center,left,right}) do
-- remove previous decals
for _, d in pairs(part:GetChildren()) do
if d:IsA("Decal") then d:Destroy() end
end
if skin.Decal then
local decal = Instance.new("Decal")
decal.Texture = "rbxassetid://"..skin.Decal
decal.Face = Enum.NormalId.Top
decal.Parent = part
end
end
end)

y = y + 35
end

-- toggle list
mainButton.MouseButton1Click:Connect(function()
listFrame.Visible = not listFrame.Visible
end)
[ View More ]
e0119014-e14a-4e2d-9374-3358192749bb.webp


HOLD J TO USE JETPACK (mobile support soon) press white square for skins. works for solara.
 
Back
Top