roblox-luau
Fungsinya
Skill ini mengajari agent menulis skrip game Roblox dengan bahasa Luau. Skill ini ditujukan untuk orang yang membangun pengalaman di Roblox Studio.
Kapan dipakai
- βSaat Anda menulis atau memperbaiki skrip Luau di Roblox Studio.
- βSaat Anda perlu memutuskan apakah kode harus berjalan di server atau di klien.
- βSaat Anda ingin klien dan server berkomunikasi melalui RemoteEvent atau RemoteFunction.
Link skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-luau/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat bagian Roblox yang memberi pemain 10 poin saat mereka menyentuhnya, dan simpan skor di server.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menjelaskan cara mendapatkan layanan Roblox, membuat dan menempatkan objek, menghubungkan event, serta membagi pekerjaan antara skrip server dan skrip klien dengan pesan yang aman.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Roblox Luau Scripting
Script a Roblox experience in Luau: services, Instances, events, the
server/client split, and secure cross-boundary communication. Targets the current
Roblox engine and Studio.
When to use
- Use when writing Roblox scripts: getting services, creating/parenting instances,
connecting events, deciding server vs client, or wiring
RemoteEvent/RemoteFunctioncommunication. - Use when the project has
Script/LocalScript/ModuleScriptobjects,.rbxl(x)places, or a Rojo*.project.json, and code callsgame:GetService(...).
When not to use: persisting data across sessions β roblox-datastores.
Remote protocol architecture, exploit hardening, rate limits, high-frequency replication, and
multi-client abuse testing β roblox-networking. Generic Lua questions unrelated to the Roblox
API. Engine-agnostic input/save architecture β input-systems / save-systems.
Core workflow
- Get services with
game:GetService("Name"). Common ones:Players,Workspace,ReplicatedStorage(shared client+server),ServerScriptService(server-only code),ServerStorage,RunService,UserInputService(client). - Know where code runs. A
Scriptruns on the server; aLocalScriptruns on a client (inStarterPlayerScripts,StarterGui, or the player's character). AScriptwhoseRunContextisClientalso runs on clients, fromReplicatedStorage; checkRunContextbefore deciding where aScriptruns. AModuleScriptis shared code yourequire. - Create instances deliberately.
local p = Instance.new("Part"), set its properties, then setp.Parentlast (parenting triggers replication). - React with events.
:Connectto signals likePlayers.PlayerAdded,part.Touched, orRunService.Heartbeat. Disconnect when done to avoid leaks. - Cross the client/server boundary with Remotes β and never trust the client.
Clients request via
RemoteEvent:FireServer(...); the server validates and applies. The server is authoritative for all game state. - Test in Studio with Test / Test Here / Server & Clients; use the Output window and the Client/Server toggle to confirm where code ran.
- Run static checks before Studio when the project already has the tools. Put
std = "roblox"in the rootselene.toml, then runselene .. For a Rojo project, write the sourcemap once withrojo sourcemap default.project.json --output sourcemap.json, then runluau-lsp analyze --sourcemap=sourcemap.json src, passing the Roblox type definitions with--definitions(luau-lsp analyze --helplists the flags). Studio Script Sync projects may not have a sourcemap.
Patterns
1. Server Script: react to players joining (leaderstats)
-- ServerScriptService/Leaderboard.server.luau (a Script = runs on the server)
local Players = game:GetService("Players")
local function onPlayerAdded(player: Player)
local stats = Instance.new("Folder")
stats.Name = "leaderstats" -- this name makes it show on the leaderboard
local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Value = 0
coins.Parent = stats
stats.Parent = player -- parent LAST
end
Players.PlayerAdded:Connect(onPlayerAdded)
2. Create and configure an instance
local Workspace = game:GetService("Workspace")
local part = Instance.new("Part")
part.Size = Vector3.new(4, 1, 4)
part.Position = Vector3.new(0, 10, 0)
part.Anchored = true -- won't fall under gravity
part.BrickColor = BrickColor.new("Bright blue")
part.Parent = Workspace -- set Parent last so it replicates once, fully
3. Connect an event (and disconnect to avoid leaks)
local debounce = false
local connection
connection = part.Touched:Connect(function(hit: BasePart)
local character = hit.Parent
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if not humanoid or debounce then return end
debounce = true
humanoid.Health -= 10
task.wait(1) -- task.wait, NOT the deprecated wait()
debounce = false
end)
-- Later, when the part is removed or the round ends:
-- connection:Disconnect()
4. Client β server with a RemoteEvent (validate on the server!)
-- ReplicatedStorage: create a RemoteEvent named "BuyItem" (in Studio or via code).
-- CLIENT (
Pertanyaan umum
Apa itu Luau?
Luau adalah bahasa pemrograman yang dipakai di Roblox untuk skrip game.
Apa perbedaan Script dan LocalScript?
Script berjalan di server, sedangkan LocalScript berjalan di perangkat setiap pemain.
Apakah ini mencakup penyimpanan data?
Tidak. Penyimpanan data dicakup oleh skill DataStore yang terpisah.
Detail
Deskripsi asli dari pembuat
Script a Roblox experience in Luau: get services, create and parent Instances, connect events, run server Scripts vs client LocalScripts, and communicate across the client/server boundary with RemoteEvents/RemoteFunctions (server-authoritative). Use when building or debugging Roblox Studio scripts β when the user mentions Roblox, Luau, services, RemoteEvent, Instance.new, PlayerAdded, or client vs server. For saving player data use roblox-datastores.
Popularitas
- Bintang GitHub
- 6.6k
- Peringkat
- #13838
- Lisensi
- Apache-2.0
- Diperbarui
- 28/10/2026
Komentar
- β¦
Skill lain dari repositori ini
router
6.6kMembantu agent Anda memilih skill pengembangan game yang tepat untuk setiap permintaan dengan mendeteksi engine Anda dan jenis tugas yang Anda perlukan.
ai-behavior-trees-utility-ai
6.6kMembantu agent Anda membangun behavior tree dan sistem utility AI untuk musuh dan karakter game yang memilih aksi berdasarkan prioritas dan skor.
audio-design
6.6kMengajari agent Anda cara mixing audio game: bus, volume dalam desibel, ducking di bawah dialog, musik adaptif, dan variasi efek suara.
camera-systems
6.6kMembantu agent Anda membangun kamera game yang mengikuti dengan halus, tetap berada di dalam level, dan dapat mengorbit atau melihat sekeliling dalam 3D.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.