Coin Collector
Roblox Studio
Your mission: Pick up Coin Parts and print a rising total.
⏱ 20–25 min · Skills: events · tables · state
Step 1 — Understand
1 min
Do this
- Look at the finished coin collector idea.
- Read your mission.
Why? Seeing the goal first makes Studio steps clearer.
Check: I know what success looks like.
Step 2 — Build in Explorer
2 min
Do this
- Open Explorer.
- Create the Parts named in the instructions.
- Turn Anchored on when needed.
Why? Without Anchored, Parts can fall when you press Play.
Check: Workspace → Coin (xN) + Script in SSS
Step 3 — Add the Script
3 min
Do this
- Insert a Script in the correct place.
- Paste the starter code.
- Read each line once.
Why? script.Parent tells the Script which object to control.
local Workspace = game:GetService("Workspace")
local coins = 0
local collected = {}
local function setupCoin(coin)
coin.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if not humanoid or collected[coin] then return end
collected[coin] = true
coins += 1
print("Coins:", coins)
coin:Destroy()
end)
end
for _, child in Workspace:GetChildren() do
if child.Name == "Coin" and child:IsA("BasePart") then
setupCoin(child)
end
end
Click a line below to highlight the concept (simulation).
Select a line to see what it does.
Place this Script where the project steps say. Use Explorer + Properties. This page is not Roblox Studio.
Press Play in Studio, open Output, and verify the mission behavior.
Step 4 — Test
2 min
Do this
- Press Play.
- Open Output.
- Verify the behavior.
Why? Output shows prints and errors immediately.
Step 5 — Modify
2 min
Do this
- Change one number or message.
- Playtest again.
Why? Small changes prove you understand the code.
Step 6 — Challenge
3 min
Do this
- Complete Challenge 1.
- Try the Creator challenge if ready.
Why? Challenges move you from copying to creating.
Challenges
EASY — Rare coin
Award +5 for CoinRare.
CREATOR — Respawn
Respawn after 10s.
BOSS — Leaderstat
Show coins on leaderstats (advanced).
You built a Roblox mechanic
- ✓ Tables
- ✓ Game state
- ✓ Events