Roblox Lua Scripting for Beginners: Create Your First Script with Delta
Writing your first Roblox Lua script for Delta is a rite of passage. Once you understand the basics, you stop hunting broken scripts online and start building exactly what you need. The best part is Roblox’s language, Luau, is one of the easiest programming languages to learn. If you can read English, you can read Luau. This guide takes you from zero knowledge to writing, running, and understanding seven working scripts for Delta, including walk speed, jump power, anti-AFK, infinite jump, teleport, basic ESP, and auto-click. We explain every line, so you walk away actually knowing why each script works, not just copying code.
Why Learn to Write Your Own Scripts
You could keep downloading scripts from pastebin forever. But three problems hit you eventually.
- Scripts break. Games update their internal names and your copied script stops working. Our script not working guide explains this.
- Scripts are not exactly what you want. You want walk speed 32, but the script says 50. You want ESP in green, but the script forces red.
- Many scripts are obfuscated or malicious. Readable scripts can be audited; obfuscated ones can steal your Roblox cookies.
Once you can write even 20 lines of Luau, you fix broken scripts, tweak features exactly how you want them, and spot sketchy code before it runs.
What Is Luau (the Language)
Roblox uses a custom variant of Lua called Luau. It is based on Lua 5.1 with extra features Roblox added, including type checking, continue statements, and a bunch of quality-of-life improvements.
Three things matter for you as a beginner:
- Luau is dynamic. You do not need to declare types unless you want to.
- Luau is interpreted. Your script runs immediately when Delta executes it; no compile step.
- Luau is simple. Short code does a lot. A walk speed script is literally three lines.
Compared to Python or JavaScript, Luau has fewer symbols and uses English words like and, or, not instead of &&, ||, !. Beginners usually read Luau faster than JavaScript.
Setup Before You Script
You need three things to practice safely.
- Delta Executor installed. Download from deltaexecutions.com for Android, iOS, PC, or Mac.
- An empty baseplate test game. Open Roblox, search “Baseplate,” join a popular one, or open one in a private server. This gives you a safe sandbox with no anti-cheat drama.
- A text editor to draft scripts outside Delta. Notepad is fine, Notepad++ or VS Code is better. Drafting outside Delta lets you save scripts, use syntax highlighting, and keep a library of your own code.
Never test experimental scripts in competitive games. A bugged infinite loop can crash your Roblox client or get you flagged. Practice in empty baseplates, then move to real games once scripts are stable. For general executor setup, see our Delta tutorial.
Core Luau Syntax Basics
You can learn these in 10 minutes. These are literally all you need for the scripts in this guide.
Hold values
local speed = 50 stores 50 in a variable called speed. Use local for everything to keep scope clean.
Text data
local name = “Alice”. Strings go inside quotes. Join strings with .. like “Hello “..name.
Blocks of code you call
local function greet() print(“hi”) end. Call with greet(). Functions can take arguments.
Decide between paths
if speed > 10 then print(“fast”) else print(“slow”) end. Always close with end.
Repeat a fixed number of times
for i = 1, 10 do print(i) end prints 1 through 10. Great for processing lists.
Repeat until condition changes
while wait() do print(“tick”) end runs forever with a small delay. Use for background tasks.
Lists and dictionaries
local players = {“Alice”, “Bob”}. Access with players[1]. Tables are everywhere in Roblox.
Code that fires on actions
part.Touched:Connect(function() print(“hit”) end). Events wait and fire when something happens.
Essential Roblox Services
Roblox exposes functionality through services. You call game:GetService(“ServiceName”) to get a reference, then use it. These are the ones you use constantly.
| Service | What It Does | When You Use It |
|---|---|---|
| Players | Access to all players in server | Getting LocalPlayer, iterating players, ESP |
| Workspace | Contains everything in the 3D world | Finding parts, characters, props |
| RunService | Frame events (Heartbeat, Stepped) | Per-frame scripts, physics loops |
| UserInputService | Keyboard and mouse input | Hotkeys, key-triggered actions |
| ReplicatedStorage | Shared remote events | Calling game remotes |
| TeleportService | Moving players between places | Server hop scripts |
| VirtualUser | Simulates input (anti-AFK trick) | Preventing idle kick |
The LocalPlayer pattern
You use this almost every script.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
These four lines give you reliable access to your own character and Humanoid, even if your character has not loaded yet. Most scripts start this way.
Script 1: Walk Speed Changer
The hello-world of Roblox scripting. Changes your walking speed to whatever number you want.
-- Walk Speed Changer
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = 50 -- default is 16, try 50 for fast, 100 for very fast
How it works
Luau comments start with —. We grab the Players service, get our own player, wait for our character to exist, then set the Humanoid’s WalkSpeed property. Default is 16. Values above 50 feel bouncy; above 200, you fly off ramps.
Common issue
Some games reset WalkSpeed every frame to prevent speed hacks. To defeat that, wrap the assignment in a loop:
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
RunService.Heartbeat:Connect(function()
local char = player.Character
if char and char:FindFirstChild("Humanoid") then
char.Humanoid.WalkSpeed = 50
end
end)
Script 2: Jump Power Boost
Same pattern, different property. Makes you jump much higher.
-- Jump Power Boost
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
-- Roblox has two systems: older JumpPower and newer JumpHeight
if humanoid.UseJumpPower then
humanoid.JumpPower = 100 -- default is 50
else
humanoid.JumpHeight = 25 -- default is 7.2
end
Why the if statement
Roblox transitioned from JumpPower to JumpHeight recently. Some games still use the old system, some use the new. Our script checks which one is active and sets the right property. This is a common professional pattern.
Script 3: Anti-AFK
Roblox kicks idle players after 20 minutes. This script simulates input every 15 minutes, so you never idle out. Great for AFK farming scripts you may be using from our script library.
-- Anti-AFK (prevents idle kick)
local Players = game:GetService("Players")
local VirtualUser = game:GetService("VirtualUser")
local player = Players.LocalPlayer
player.Idled:Connect(function()
VirtualUser:CaptureController()
VirtualUser:ClickButton2(Vector2.new())
end)
How it works
Roblox fires an Idled event on your player when you have been inactive. We catch that event and use VirtualUser to simulate a right-click. Roblox resets the idle timer. You never get kicked.
This is one of the most useful utility scripts. Add it to your autoexecute folder (see our autoexecute guide) so it loads every session.
Script 4: Infinite Jump
You can jump in mid-air, repeatedly. Useful for climbing obstacles and parkour.
-- Infinite Jump
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local player = Players.LocalPlayer
UIS.JumpRequest:Connect(function()
local char = player.Character
if char and char:FindFirstChildOfClass("Humanoid") then
char:FindFirstChildOfClass("Humanoid"):ChangeState(
Enum.HumanoidStateType.Jumping
)
end
end)
How it works
Roblox fires JumpRequest every time you press space (or tap jump on mobile). Normally Roblox blocks mid-air jumps. We force the Humanoid into the Jumping state regardless, so each jump triggers a new one, infinitely.
Script 5: Teleport to Player
Instantly moves your character to another player’s position. A core function in most Delta hubs.
-- Teleport to a Player by name
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local function teleportTo(targetName)
local target = Players:FindFirstChild(targetName)
if not target then
warn("Player not found: "..targetName)
return
end
local myChar = player.Character
local theirChar = target.Character
if myChar and theirChar then
local myRoot = myChar:FindFirstChild("HumanoidRootPart")
local theirRoot = theirChar:FindFirstChild("HumanoidRootPart")
if myRoot and theirRoot then
myRoot.CFrame = theirRoot.CFrame + Vector3.new(0, 3, 0)
end
end
end
-- Call it like this:
teleportTo("Alice") -- replace with any player's username in the server
How it works
We define a reusable function called teleportTo. It finds the target player, grabs both characters’ HumanoidRootPart (the invisible center piece that controls position), and sets our position to theirs plus 3 units up (so we do not collide awkwardly). CFrame is Roblox’s position-and-rotation structure.
Variation: teleport to coordinates
local player = game:GetService("Players").LocalPlayer
local char = player.Character
if char and char:FindFirstChild("HumanoidRootPart") then
char.HumanoidRootPart.CFrame = CFrame.new(100, 50, -200) -- X, Y, Z
end
Script 6: Basic ESP (Name Tags)
Adds a name tag above every player so you can see them through walls. The simplest version of ESP you can build.
-- Basic Player ESP (name tags through walls)
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local function addESP(targetPlayer)
if targetPlayer == localPlayer then return end
targetPlayer.CharacterAdded:Connect(function(char)
local head = char:WaitForChild("Head")
local gui = Instance.new("BillboardGui")
gui.Name = "ESP"
gui.Size = UDim2.new(0, 200, 0, 50)
gui.StudsOffset = Vector3.new(0, 3, 0)
gui.AlwaysOnTop = true
gui.Parent = head
local label = Instance.new("TextLabel")
label.Size = UDim2.new(1, 0, 1, 0)
label.BackgroundTransparency = 1
label.Text = targetPlayer.Name
label.TextColor3 = Color3.fromRGB(0, 255, 0)
label.TextStrokeTransparency = 0
label.TextScaled = true
label.Font = Enum.Font.GothamBold
label.Parent = gui
end)
if targetPlayer.Character then
targetPlayer.CharacterAdded:Fire(targetPlayer.Character)
end
end
for _, p in ipairs(Players:GetPlayers()) do addESP(p) end
Players.PlayerAdded:Connect(addESP)
How it works
For each player (now and future joins), we add a BillboardGui to their Head part. BillboardGui is a 3D UI that floats in space. AlwaysOnTop makes it visible through walls. A TextLabel inside shows their username in green. That is it.
From this base, you can add distance, health bars, team color, boxes (chams), and more. ESP is a stackable pattern.
Script 7: Auto-Click
Clicks the mouse at a fixed interval. Useful for clicker games and simple farming.
-- Auto Click (every 0.1 seconds)
local VirtualInputManager = game:GetService("VirtualInputManager")
local running = true
task.spawn(function()
while running do
VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 0)
task.wait(0.05)
VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 0)
task.wait(0.05)
end
end)
-- To stop it, set running = false in a later execution
-- Or add a hotkey like this:
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
running = false
print("Auto clicker stopped")
end
end)
How it works
VirtualInputManager simulates a real left-click. We put it in a loop with task.wait (which is more accurate than regular wait). Press F to stop. task.spawn runs the loop in a separate coroutine so the rest of the script does not block.
Executor-Only Functions (Delta Extras)
Delta gives you access to functions that regular Roblox scripts cannot use. These are the ones you will use most.
| Function | Purpose | Example |
|---|---|---|
| getgenv() | Access to Delta’s shared environment | getgenv().mySettings = {…} |
| setclipboard() | Copy text to device clipboard | setclipboard(“hello”) |
| hookfunction() | Replace a game function with yours | Advanced, use carefully |
| getconnections() | List event connections on a signal | Debug and disconnect loops |
| queue_on_teleport() | Re-run a script after server hop | queue_on_teleport(script) |
| setfpscap() | Raise frame rate cap | setfpscap(240) |
| http_request() / request() | Make HTTP requests from Lua | Fetch data from APIs |
Delta implements most of the UNC (Universal Naming Convention) functions, which are the standard for script compatibility across executors. If a script says “requires UNC,” it works on Delta. Our UNC guide explains Delta’s test scores.
Debugging and Reading Errors
Scripts fail. Reading errors is 50 percent of being a script maker.
Where errors appear
Delta’s output console (usually a tab at the top of the UI) shows errors from your script. Open it before you run.
Common error patterns
| Error Message | What It Means | Fix |
|---|---|---|
| attempt to index nil | You tried to use something that does not exist | Check if object exists before using (use FindFirstChild) |
| WalkSpeed is not a valid member | Wrong object; probably used Character not Humanoid | Use character:FindFirstChildOfClass(“Humanoid”) |
| ‘ expected near ‘end’ | Syntax error, missing a bracket or closer | Check your parentheses and function closings |
| Script timeout | Your loop runs too long without yielding | Add task.wait() inside the loop |
| attempt to call nil value | You called a function that does not exist | Check spelling and that the function was defined |
Safe-run pattern
For scripts you are not sure about, wrap them in pcall:
local success, result = pcall(function()
-- your risky code here
local x = someUnknownThing.value
end)
if not success then
warn("Script failed: "..tostring(result))
end
pcall catches errors so a single failure does not crash the whole script. Use it for anything touching external objects that might not exist.
Where to Go Next
You now have the skills to write dozens of useful scripts. To level up, work on these next:
- Learn remote events. Most game-specific hacks (like infinite money in a merchant game) call RemoteEvents or RemoteFunctions with specific arguments. Reading other scripts teaches you how.
- Learn UI libraries. Rayfield, Orion, and Kavo let you build menus with toggles, sliders, and buttons. Instead of hardcoding WalkSpeed, give yourself a slider.
- Learn CFrame math. Teleports, aimbots, and prediction all rely on CFrame manipulation. It is the trickiest concept in Roblox but opens the most doors.
- Study other peoples’ scripts. Read scripts from our library line by line and understand every one.
- Visit the official Roblox API docs. Every property, every method, every event is documented there.
- Visit the official Luau language docs. The syntax reference is clean and short.
Writing scripts is a skill that compounds. Every script you write makes the next one faster. After 10 scripts, you stop being a beginner. After 50, you can build full hubs.
The Bottom Line
Luau is one of the most beginner-friendly languages in existence, and Delta’s executor exposes it fully. With the seven scripts in this guide and the core syntax basics, you have everything you need to stop copying and start building. Draft in a text editor, test in empty baseplates, read errors from Delta’s console, and expand from working examples. Download Delta from deltaexecutions.com. For related guides, see our Delta tutorial, script library, and autoexecute guide.
Frequently Asked Questions
Is making Roblox scripts for Delta hard?
No. Luau (Roblox’s Lua variant) is one of the easiest programming languages to learn. If you can read English, you can read Luau. Your first useful script (like a walk speed changer) is three lines long. A full working anti-AFK script is six lines. The hardest part is remembering the Roblox services, which is just a reference lookup. Most beginners write their first working script within 10 to 15 minutes of starting.
What language does Delta Executor use?
Delta executes Luau, which is Roblox’s variant of Lua 5.1 with extra features like type checking and continue statements. Delta also exposes executor-only functions (getgenv, setclipboard, hookfunction, setfpscap, etc.) that regular Roblox scripts cannot use. These extra functions follow the UNC (Universal Naming Convention) standard, so scripts written for one executor usually work on Delta.
Do I need Roblox Studio to write scripts for Delta?
No, but it helps. Delta runs scripts you paste into its input box, so a plain text editor like Notepad is enough. However, Roblox Studio lets you test scripts in a live Luau environment with full documentation, intellisense, and no anti-cheat risk. Many script makers draft in Studio, then paste into Delta for real-game testing.
Can I write Delta scripts on mobile?
Yes. Delta on Android and iOS runs the same Luau that the PC version runs, and the script input box accepts the same code. You can paste in scripts from a mobile text editor or type directly into Delta. Testing is harder on mobile because the output console is cramped, but scripting itself is identical. Many top script developers write primarily on PC and test on mobile.
Why does my script work in Studio but not in Delta?
Studio runs scripts as server scripts by default, while Delta runs them as client-side LocalScripts. The two have different access to certain services and objects. Also, Delta scripts cannot create physical server-side changes (like truly changing game logic), only local client visuals and behaviors. If a script changes something only you see, it will work. If it tries to change server state, it will not, unless it goes through a RemoteEvent the game exposes.
Can I sell scripts I write for Delta?
Yes, many script developers sell their own scripts through Discord servers, pastebin obfuscation services, or script marketplaces. There is an entire economy around script creation. However, always write original scripts; copying someone else’s code and reselling it is both unethical and tends to backfire in small developer communities where people know each other.
What is the difference between wait and task.wait in Luau?
wait() is older and less accurate; it can delay up to 30ms longer than requested. task.wait() is newer, more accurate, and uses Roblox’s task scheduler for predictable timing. Always use task.wait() for new code. Same applies to task.spawn() over spawn() and task.delay() over delay(). These replacements landed in Roblox around 2021 and are universally supported now.
How long does it take to become a good Delta script maker?
About 2 to 4 weeks of consistent practice to go from zero to building your own working hub. You can write your first functional script in your first hour. After 10 scripts, you understand the core patterns. After 50 scripts, you can read and modify any Luau code you find. Learning CFrame math, UI libraries, and remote event hooks takes another 1 to 2 months beyond that. The whole journey rewards you fast; results come early, which keeps motivation high.
References
- DeltaExecutions, Script Development Hub, deltaexecutions.com
- Roblox Creator Documentation: Engine API Reference
- Luau Language Official Documentation
- DeltaExecutions internal script library and testing archive (recently updated)
