Run it
Copy the script and paste it into your executor.
Players = :()
RunService = :()
Workspace = :()
UserInputService = :()
TweenService = :()
Lighting = :()
env = ( ())
env.__DroneCleanup (env.__DroneCleanup)
player = Players.LocalPlayer
character = player.Character player.CharacterAdded:()
rootPart = character:()
camera = Workspace.CurrentCamera
Workspace:() Workspace.RealisticDroneModel:()
player.PlayerGui:() player.PlayerGui.DJIRCControlGui:()
SPEED, VSPEED, YAW_SPEED = , ,
DEFAULT_FOV =
conns = {}
flying, mode = ,
battery =
yaw =
curVel = .zero
curTiltF, curTiltS = ,
rotorSpeed, rotorAngle = ,
cameraAttached, recording, recTime = , ,
fov = DEFAULT_FOV
stickL, stickR = .zero, .zero
rotors = {}
thermalOn =
colorCorrection = .()
()
character character:()
droneModel = .()
droneModel.Name =
droneModel.Parent = Workspace
dronePart = .()
dronePart.Name =
dronePart.Size = .(, , )
dronePart.Material = .Material.SmoothPlastic
dronePart.Color = .(, , )
dronePart.CanCollide =
dronePart.Parent = droneModel
droneModel.PrimaryPart = dronePart
rayParams = RaycastParams.()
rayParams.FilterType = .RaycastFilterType.Exclude
rayParams.FilterDescendantsInstances = {droneModel, character}
(pos)
r = Workspace:(pos + .(, , ), .(, -, ), rayParams)
r r.Position.Y
look = rootPart.CFrame.LookVector
startPos = rootPart.Position + look *
startGround = (startPos + .(, , ))
yaw = .(-look.X, -look.Z)
dronePart.CFrame = .(startPos.X, (startGround (rootPart.Position.Y - )) + , startPos.Z)
* .(, yaw, )
(p0, p1)
w = .()
w.Part0 = p0
w.Part1 = p1
w.C0 = p0.CFrame:(p1.CFrame)
w.Parent = p0
w
(size, offset, color, material, shape)
p = .()
p.Size = size
p.CFrame = dronePart.CFrame * offset
p.Color = color
p.Material = material .Material.SmoothPlastic
shape p.Shape = shape
p.CanCollide =
p.Massless =
p.Parent = droneModel
p, (dronePart, p)
(.(, , ), .(, -, -), .(, , ), .Material.Metal)
(.(, , ), .(, -, -), .(, , ), .Material.Glass)
(.(, , ), .(, , -), .(, , ))
lightColors = {
.(, , ),
.(, , ),
.(, , ),
.(, , ),
.(, , ),
}
lightIdx =
lightOn =
lightPart = (.(, , ), .(, , ), lightColors[], .Material.Neon)
light = .()
light.Color = lightColors[]
light.Range =
light.Brightness =
light.Parent = lightPart
_, sx ({-, })
_, sz ({-, })
corner = .(sx * , , sz * )
(.(, , corner.Magnitude), .(corner / , corner),
.(, , ))
(.(, , ),
.(corner + .(, , )) * .(, , .()),
.(, , ), .Material.Metal, .PartType.Cylinder)
blade, bw = (.(, , ),
.(corner + .(, , )) * .(, .(), ),
.(, , ), .Material.Neon)
.(rotors, {weld = bw, base = bw.C0, dir = (sx * sz > ) -})
bv = .()
bv.MaxForce = .(.huge, .huge, .huge)
bv.Velocity = .zero
bv.Parent = dronePart
bg = .()
bg.MaxTorque = .(.huge, .huge, .huge)
bg.CFrame = dronePart.CFrame
bg.Parent = dronePart
(class, props, parent)
o = .(class)
k, v (props) o[k] = v
o.Parent = parent
o
(o, r)
(, {CornerRadius = .(, r)}, o)
screenGui = (, {
Name = ,
ResetOnSpawn = ,
IgnoreGuiInset = ,
}, player:())
rcFrame = (, {
Size = .(, , , ),
Position = .(, , , ),
BackgroundColor3 = .(, , ),
BorderSizePixel = ,
}, screenGui)
(rcFrame, )
topBar = (, {
Size = .(, , , ),
BackgroundColor3 = .(, , ),
BorderSizePixel = ,
}, rcFrame)
(topBar, )
ledStatus = (, {
Size = .(, -, , ),
BackgroundTransparency = ,
Text = ,
TextColor3 = .(, , ),
TextSize = ,
Font = .Font.Code,
}, topBar)
btnClose = (, {
Size = .(, , , ),
Position = .(, -, , ),
BackgroundColor3 = .(, , ),
TextColor3 = .(, , ),
Text = ,
TextSize = ,
Font = .Font.GothamBold,
}, topBar)
(btnClose, )
screenDisplay = (, {
Size = .(, -, , ),
Position = .(, , , ),
BackgroundColor3 = .(, , ),
BorderSizePixel = ,
}, rcFrame)
(screenDisplay, )
screenLabel = (, {
Size = .(, , , ),
BackgroundTransparency = ,
Text = ,
TextColor3 = .(, , ),
TextSize = ,
Font = .Font.GothamBold,
}, screenDisplay)
btnContainer = (, {
Size = .(, -, , ),
Position = .(, , , ),
BackgroundTransparency = ,
}, rcFrame)
(, {
CellSize = .(, , , ),
CellPadding = .(, , , ),
SortOrder = .SortOrder.LayoutOrder,
}, btnContainer)
btns, btnColors = {}, {}
GRAY = .(, , )
(name, text, off, on, order)
b = (, {
BackgroundColor3 = off,
TextColor3 = .(, , ),
Text = text,
TextSize = ,
Font = .Font.GothamBold,
LayoutOrder = order,
}, btnContainer)
(b, )
btns[name] = b
btnColors[b] = {off = off, on = on off}
b
(b, isOn)
b.BackgroundColor3 = isOn btnColors[b].on btnColors[b].off
(, , .(, , ), .(, , ), )
(, , .(, , ), .(, , ), )
(, , .(, , ), .(, , ), )
(, , .(, , ), .(, , ), )
(, , GRAY, , )
(, , GRAY, , )
(, , GRAY, , )
(, , .(, , ), .(, , ), )
(, , .(, , ), .(, , ), )
(, , GRAY, , )
(, , .(, , ), .(, , ), )
(, , .(, , ), .(, , ), )
(, , .(, , ), , )
(, , .(, , ), , )
(btns.light, )
hudGui = (, {
Size = .(, , , ),
BackgroundTransparency = ,
Visible = ,
}, screenGui)
(, {
Size = .(, , , ),
AnchorPoint = .(, ),
Position = .(, , , ),
BackgroundTransparency = ,
Text = ,
TextColor3 = .(, , ),
TextSize = ,
Font = .Font.Code,
}, hudGui)
hudRec = (, {
Size = .(, , , ),
AnchorPoint = .(, ),
Position = .(, , , ),
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
TextColor3 = .(, , ),
Text = ,
TextSize = ,
Font = .Font.Code,
}, hudGui)
(hudRec, )
hudTelemetry = (, {
Size = .(, , , ),
AnchorPoint = .(, ),
Position = .(, , , -),
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
TextColor3 = .(, , ),
Text = ,
TextSize = ,
Font = .Font.Code,
}, hudGui)
(hudTelemetry, )
flash = (, {
Size = .(, , , ),
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
BorderSizePixel = ,
ZIndex = ,
}, screenGui)
toastLabel = (, {
Size = .(, , , ),
AnchorPoint = .(, ),
Position = .(, , , ),
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
TextColor3 = .(, , ),
Text = ,
TextSize = ,
Font = .Font.GothamBold,
Visible = ,
ZIndex = ,
}, screenGui)
(toastLabel, )
toastId =
(msg)
toastId +=
id = toastId
toastLabel.Text = msg
toastLabel.Visible =
.(, ()
id == toastId toastLabel.Parent toastLabel.Visible =
)
(pos, caption, callback)
base = (, {
Size = .(, , , ),
AnchorPoint = .(, ),
Position = pos,
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
BorderSizePixel = ,
Active = ,
}, screenGui)
(base, )
(, {
Size = .(, , , ),
Position = .(, , , -),
BackgroundTransparency = ,
Text = caption,
TextColor3 = .(, , ),
TextSize = ,
Font = .Font.GothamBold,
}, base)
knob = (, {
Size = .(, , , ),
AnchorPoint = .(, ),
Position = .(, , , ),
BackgroundColor3 = .(, , ),
BackgroundTransparency = ,
BorderSizePixel = ,
}, base)
(knob, )
active
(p)
center = base.AbsolutePosition + base.AbsoluteSize /
maxR = base.AbsoluteSize.X / -
delta = .(p.X, p.Y) - center
delta.Magnitude > maxR delta = delta.Unit * maxR
knob.Position = .(, delta.X, , delta.Y)
(.(delta.X / maxR, -delta.Y / maxR))
()
active =
knob.Position = .(, , , )
(.zero)
base.InputBegan:((input)
input.UserInputType == .UserInputType.Touch
input.UserInputType == .UserInputType.MouseButton1
active = input
(input.Position)
)
.(conns, UserInputService.InputChanged:((input)
active
input == active
(active.UserInputType == .UserInputType.MouseButton1
input.UserInputType == .UserInputType.MouseMovement)
(input.Position)
))
.(conns, UserInputService.InputEnded:((input)
input == active ()
))
(.(, , , -), , (v) stickL = v )
(.(, -, , -), , (v) stickR = v )
dragging, dragStart, startPos2
topBar.InputBegan:((input)
input.UserInputType == .UserInputType.MouseButton1
input.UserInputType == .UserInputType.Touch
dragging = input
dragStart = input.Position
startPos2 = rcFrame.Position
)
.(conns, UserInputService.InputChanged:((input)
dragging (input == dragging
(dragging.UserInputType == .UserInputType.MouseButton1
input.UserInputType == .UserInputType.MouseMovement))
d = input.Position - dragStart
rcFrame.Position = .(startPos2.X.Scale, startPos2.X.Offset + d.X,
startPos2.Y.Scale, startPos2.Y.Offset + d.Y)
))
.(conns, UserInputService.InputEnded:((input)
input == dragging dragging =
))
()
_, c (conns) (() c:() )
.(conns)
(()
camera.CameraType = .CameraType.Custom
camera.FieldOfView = DEFAULT_FOV
hum = ()
hum camera.CameraSubject = hum
)
colorCorrection.Parent =
droneModel droneModel:()
screenGui screenGui:()
env.__DroneCleanup =
env.__DroneCleanup = cleanup
()
btns.fly.Text = flying
(btns.fly, flying)
(m)
mode = m
(btns.rth, m == )
(btns.follow, m == )
()
rootPart.Position + rootPart.CFrame.LookVector * + .(, , )
()
rootPart.Position - rootPart.CFrame.LookVector * + .(, , )
(v, dt)
v.Magnitude <
target = .(-v.X, -v.Z)
diff = (target - yaw + .pi) % ( * .pi) - .pi
yaw = yaw + diff * .(, dt * )
()
flash.BackgroundTransparency =
TweenService:(flash, TweenInfo.(), {BackgroundTransparency = }):()
()
btns.fly.MouseButton1Click:(()
flying
mode ~= ()
battery <
()
flying =
()
()
)
btns.cam.MouseButton1Click:(()
cameraAttached = cameraAttached
hudGui.Visible = cameraAttached
(btns.cam, cameraAttached)
btns.cam.Text = cameraAttached
cameraAttached
camera.CameraType = .CameraType.Scriptable
camera.CameraType = .CameraType.Custom
camera.FieldOfView = DEFAULT_FOV
hum = ()
hum camera.CameraSubject = hum
)
btns.rth.MouseButton1Click:(()
flying ()
(mode == )
)
btns.follow.MouseButton1Click:(()
flying ()
(mode == )
)
btns.zin.MouseButton1Click:(() fov = .(, fov - ) )
btns.zout.MouseButton1Click:(() fov = .(, fov + ) )
btns.photo.MouseButton1Click:(takePhoto)
btns.rec.MouseButton1Click:(()
recording = recording
recording recTime =
btns.rec.Text = recording
(btns.rec, recording)
(recording )
)
btns.light.MouseButton1Click:(()
lightOn = lightOn
light.Enabled = lightOn
lightPart.Material = lightOn .Material.Neon .Material.SmoothPlastic
(btns.light, lightOn)
)
btns.color.MouseButton1Click:(()
lightIdx = lightIdx % #lightColors +
lightPart.Color = lightColors[lightIdx]
light.Color = lightColors[lightIdx]
btns.color.BackgroundColor3 = lightColors[lightIdx]:(.(, , ), )
)
btns.thermal.MouseButton1Click:(()
thermalOn = thermalOn
(btns.thermal, thermalOn)
thermalOn
colorCorrection.TintColor = .(, , )
colorCorrection.Contrast =
colorCorrection.Brightness =
colorCorrection.Parent = Lighting
()
colorCorrection.Parent =
()
)
btns.drop.MouseButton1Click:(()
flying
()
bomb = .()
bomb.Size = .(, , )
bomb.Position = dronePart.Position - .(, , )
bomb.Material = .Material.Neon
bomb.Color = .(, , )
bomb.Shape = .PartType.Ball
bomb.Parent = Workspace
touchedConn
touchedConn = bomb.Touched:((hit)
hit ~= dronePart hit.Parent ~= droneModel
touchedConn:()
exp = .()
exp.Position = bomb.Position
exp.BlastRadius =
exp.BlastPressure =
exp.Parent = Workspace
bomb:()
)
()
)
btns.pull.MouseButton1Click:(()
target = rootPart.Position + rootPart.CFrame.LookVector *
y
flying
y = target.Y +
gy = (target + .(, , ))
y = (gy (target.Y - )) +
dronePart.CFrame = .(target.X, y, target.Z) * .(, yaw, )
curVel = .zero
)
btns.boom.MouseButton1Click:(()
dronePart dronePart.Parent
explosion = .()
explosion.Position = dronePart.Position
explosion.BlastRadius =
explosion.BlastPressure =
explosion.Parent = Workspace
()
)
btnClose.MouseButton1Click:(cleanup)
.(conns, player.CharacterAdded:((c)
character = c
rootPart = c:()
rayParams.FilterDescendantsInstances = {droneModel, c}
))
()
stickL.X, stickL.Y, stickR.X, stickR.Y
modeNames = {
manual = , takeoff = , rth = ,
follow = , land = ,
}
uiTimer =
.(conns, RunService.RenderStepped:((dt)
dronePart.Parent ()
pos = dronePart.Position
gy = (pos)
minY = gy (gy + ) -.huge
yawIn, vertIn, strafeIn, fwdIn = ()
inputMag = .(yawIn) + .(vertIn) + .(strafeIn) + .(fwdIn)
vel = .zero
tiltF, tiltS = ,
flying
battery = .(, battery - dt * ( + curVel.Magnitude / ))
battery <= mode ~=
()
()
inputMag > battery > (mode == mode == mode == )
()
mode ==
vel = .(, , )
pos.Y - (gy (pos.Y - )) >= ()
mode ==
yaw = yaw - yawIn * dt * YAW_SPEED
horiz = .(, yaw, ):(
.(strafeIn * SPEED, , -fwdIn * SPEED))
vel = horiz + .(, vertIn * VSPEED, )
tiltF, tiltS = fwdIn, strafeIn
mode ==
d = () - pos
flat = .(d.X, , d.Z)
flat.Magnitude >
vel = flat.Unit * .(SPEED, flat.Magnitude * )
+ .(, .(d.Y * , -VSPEED, VSPEED), )
(flat, dt)
tiltF =
()
mode ==
d = () - pos
vel = d *
vel.Magnitude > SPEED * vel = vel.Unit * SPEED *
toPlayer = rootPart.Position - pos
(.(toPlayer.X, , toPlayer.Z), dt)
mode ==
vel = .(, -, )
gy pos.Y <= minY +
flying =
()
()
()
pos.Y <= minY vel.Y <
vel = .(vel.X, , vel.Z)
battery = .(, battery + dt * )
curVel = curVel:(vel, .(, dt * ))
curTiltF = curTiltF + (tiltF - curTiltF) * .(, dt * )
curTiltS = curTiltS + (tiltS - curTiltS) * .(, dt * )
bv.Velocity = curVel
bg.CFrame = .(, yaw, ) * .(-curTiltF * , , -curTiltS * )
targetRotor = flying ( + curVel.Magnitude * )
rotorSpeed = rotorSpeed + (targetRotor - rotorSpeed) * .(, dt * )
rotorAngle = rotorAngle + rotorSpeed * dt
_, r (rotors)
r.weld.C0 = r.base * .(, rotorAngle * r.dir, )
cameraAttached
gp = dronePart.CFrame:(.(, -, -))
camera.CFrame = .(gp) * .(, yaw, )
camera.FieldOfView = fov
recording recTime += dt
uiTimer += dt
uiTimer >=
uiTimer =
alt = gy (pos.Y - gy) pos.Y
dist = (pos - rootPart.Position).Magnitude
zoomX = DEFAULT_FOV / fov
bat = .(battery)
telemetry = .(,
.(alt), .(curVel.Magnitude), .(dist), bat, zoomX)
state = flying modeNames[mode] (battery < )
screenLabel.Text = .. state .. .. telemetry
hudTelemetry.Text = telemetry
bc = battery > .(, , )
battery > .(, , )
.(, , )
ledStatus.TextColor3 = bc
ledStatus.Text = .(, bat)
recording
blink = .(recTime * ) % ==
hudRec.Text = .(, blink ,
.(recTime / ), .(recTime % ))
hudRec.Text =
))
()Um script avançado em Luau com um drone 3D totalmente funcional, otimizado para telemóvel e PC. - Controles táteis (joysticks virtuais) para altura, rotação e movimento. - Vários modos de voo: Manual, Descolagem, Regressar a Casa (RTH), Seguir e Aterragem. - Câmara FPV com HUD, telemetria em tempo real (altitude, velocidade, distância, bateria) e zoom. - Efeitos e extras: Luzes LED personalizáveis, Visão Térmica, Largar Bombas com explosão e Autodestruição.

Universal