roblox-characters
Fungsinya
Skill ini menunjukkan cara menulis skrip karakter Roblox yang bertahan dari respawn, kematian, dan perubahan lainnya. Skill ini ditujukan untuk developer yang membangun karakter pemain di pengalaman Roblox.
Kapan dipakai
- ✓Saat skrip karakter Anda rusak setelah pemain melakukan respawn di Roblox.
- ✓Saat Anda perlu mengendalikan gerakan karakter, memainkan animasi, atau menangani kematian.
- ✓Saat Anda ingin memasang tool atau mengganti aksesori pada karakter pemain.
Link skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/roblox-characters/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
“Kecepatan karakter Roblox saya kembali normal setelah respawn. Bagaimana cara memperbaiki skripnya?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menjelaskan bahwa pemain tetap sama di antara respawn sedangkan karakter adalah tubuh sementara yang dibuat ulang, sehingga agent memisahkan data yang bertahan lama dari koneksi khusus karakter dan membersihkannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Roblox characters
Treat a Player as the durable identity and each Character as a replaceable session with its own
references, connections, animation tracks, and cleanup. Targets Roblox's rolling platform APIs.
When to use
- Use for player-character lifecycle, Humanoid state/movement, rigs, animations, tools, accessories, custom characters, death, or respawn defects.
- Use whenever code stores a Character/Humanoid/root reference longer than one spawn.
When not to use: general physics queries and constraints belong to roblox-physics; remote
trust belongs to roblox-networking; camera logic belongs to camera-systems.
Workflow
- Inspect the character contract. Check avatar settings,
StarterCharacter,StarterCharacterScripts,CharacterAutoLoads, R6/R15 support, existing Animate/controller scripts, tools, tags, collision groups, and server/client ownership. - Separate scopes. Player-scope state survives respawn; character-scope state does not. Put character connections/tracks/resources in one cleanup scope and destroy it on removal.
- Bind existing and future characters. Connect
CharacterAdded, then bindplayer.Characterif present. Do not assume event subscription alone sees a character that already spawned. - Resolve required components defensively. Wait with a timeout where replication warrants it;
validate
Humanoid, root,Animator, and rig assumptions. Abort if that character is no longer current before applying delayed work. - Choose movement ownership. Use Humanoid movement for standard avatars; use
AssemblyLinearVelocity,BasePart:ApplyImpulse(), or aLinearVelocity/AlignPositionconstraint only for mechanics that need physical control. Keep gameplay authority and network ownership implications explicit. - Own animation lifecycle. Load via the rig's
Animator; store tracks/connections; use named markers for gameplay timing only with server validation; stop/disconnect on character cleanup. - Verify lifecycle stress. Spawn, die, reset, rapid-respawn, swap rig if supported, equip/drop tools, leave during setup, and run with at least two players when character interactions matter.
Pattern: replaceable character scope
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local generation = 0
local connections: {RBXScriptConnection} = {}
local currentCharacter: Model? = nil
local function clearCharacter()
generation += 1
for _, connection in connections do connection:Disconnect() end
table.clear(connections)
currentCharacter = nil
end
local function bindCharacter(character: Model)
-- Guard BEFORE teardown. A stale invocation (see the CharacterAdded/defer race below) must not
-- clear a binding that is already current, or nothing ends up bound at all.
if player.Character ~= character then return end
clearCharacter()
currentCharacter = character
local thisGeneration = generation
local humanoid = character:WaitForChild("Humanoid", 10)
local root = character:WaitForChild("HumanoidRootPart", 10)
-- Re-check after the yields: a respawn during WaitForChild bumps generation and makes this call stale.
if not humanoid or not root or generation ~= thisGeneration then return end
table.insert(connections, humanoid.Died:Connect(function()
if generation ~= thisGeneration then return end
setCharacterUiEnabled(false)
end))
attachCurrentCharacterSystems(character, humanoid, root)
end
player.CharacterRemoving:Connect(function(character)
if currentCharacter == character then clearCharacter() end
end)
player.CharacterAdded:Connect(bindCharacter)
if player.Character then task.defer(bindCharacter, player.Character) end
Use the project's cleanup utility when one exists; do not introduce a new framework for three
connections. Server systems repeat this binding per Player and clear player-scope tables on
PlayerRemoving.
Pattern: animation through Animator and markers
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://1234567890"
local track = animator:LoadAnimation(animation)
local markerConnection = track:GetMarkerReachedSignal("Commit"):Connect(function(parameter)
playLocalSwingEffect(parameter) -- presentation; server still validates any hit
end)
track:Play(0.1)
-- On character teardown:
markerConnection:Disconnect()
track:Stop(0.1)
animation:De
Pertanyaan umum
Apa perbedaan pemain dan karakter di Roblox?
Pemain tetap sama selama bermain, sedangkan karakter adalah tubuh baru yang dibuat pada setiap pemunculan.
Apakah ini mencakup rig R6 dan R15?
Ya. Skill mencakup kedua jenis rig saat menyiapkan animasi dan bagian karakter.
Apakah ini mencakup fisika atau remote?
Keduanya adalah skill Roblox terpisah, satu untuk fisika dan satu untuk jaringan.
Detail
Deskripsi asli dari pembuat
Build respawn-safe Roblox character systems around Players, CharacterAdded/CharacterRemoving, Humanoid, HumanoidRootPart, Animator, R6/R15 rigs, movement, animations and markers, death, tools, accessories, ownership, and custom characters. Use when character scripts break after respawn, cache stale Humanoids, control movement or velocity, load AnimationTracks, handle death, equip Tools, modify avatars, or support custom player rigs.
Popularitas
- Bintang GitHub
- 6.6k
- Peringkat
- #13836
- 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.