Module 13 · In Studio · challenge 3 of 3 in this lesson
newSignal connects in order, disconnects once, supports Once, and survives changes made while it fires
A test in Studio grades it and prints a pass code.
Open
Level 3, Professional
Challenge
Write the three tools in challenges/work/player_scope.luau. The written solution is challenges/solutions/lifetimes-and-leaks.md. In Play, run game.ServerScriptService.RunGameTests:Invoke("lifetimes-and-leaks", "leaks-scopes") and paste the pass code here.
- Start from
- The game at milestone m14 (download)
- Grade it
- In Studio, press Play, then run
game.ServerScriptService.RunGameTests:Invoke("lifetimes-and-leaks", "leaks-scopes")in the server command bar. Copy the pass code from Output.
Done means
- newSignal connects in order, disconnects once, supports Once, and survives changes made while it fires
- newScope adds functions, connections and destroyables, tracks table keys, cleans newest first and only once
- newPlayerScopes gives one scope per player and releases it safely
- After 200 fake players join and leave, every per-player table is empty and every connection is gone
- challenges/lifetimes-and-leaks.luau prints TEST PASS for every check