Roblox Lua Beginner Guide
Roblox Lua Beginner Guide
Introduction
Welcome to the Roblox Lua Beginner Guide. In this guide, you will learn the basics of Lua
programming and how to use it in Roblox Studio.
What is Lua?
Lua is a lightweight scripting language widely used in game development. Roblox uses a version of
Lua called Luau.
print('Hello, Roblox!')
Variables
Functions
function greet()
print('Hello!')
end
greet()
Events
part.Touched:Connect(function(hit)
print('Part touched!')
end)
Example:
script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild('Humanoid')
if humanoid then
humanoid.Health = 0
end
end)
game.Players.PlayerAdded:Connect(onPlayerAdded)
Remote Events
RemoteEvents allow communication between client and server. Useful for GUIs and attacks.
Next Steps
Learn OOP, DataStores, RemoteEvents, GUIs, and advanced systems like combat or inventory.
Resources