Draft preview · this lesson is still being technically validated. Browser experiments and reference material remain available; trusted completion is enabled after publication.
v2 · Activity 1 of 4 · events · connections · 28 min Requires Roblox Studio
An event announces something that happened. prompt.Triggered:Connect(callback) registers a callback; it does not immediately call that callback.
Triggered supplies the Player who used the prompt. Use that parameter rather than guessing which player interacted.
Put a ProximityPrompt inside WorkshopLamp. Connect once on the server and print Lamp requested followed by the triggering player’s name.
Interface: Complete the documented Studio hierarchy and self-check the behavior outside the browser.
| Input | Expected |
|---|
local connection = prompt.Triggered:Connect(function(player)
print("Visitor", player.Name)
end)Connect returns a connection, which can later be disconnected. The callback runs when the event fires.
New syntax: events, connections
Your explanation is a self-check. Exact wording is not automatically graded.
Self-checked Studio exercise. A saved checklist records your own review; no uploaded place file or screenshot is executed here.
Workspace/WorkshopLamp (anchored Part) ProximityPrompt ServerScriptService/PromptLog (Script, RunContext=Server)
Main guided reference implementation; use the hierarchy’s stated Script or ModuleScript type.
local lamp = game:GetService("Workspace"):WaitForChild("WorkshopLamp")
local prompt = lamp:WaitForChild("ProximityPrompt")
prompt.Triggered:Connect(function(player)
print("Lamp requested", player.Name)
end)A missing prompt usually means the hierarchy or name differs.
Duplicate lines often mean duplicate connections or duplicate scripts.
This is a bounded learning lab. It has not been executed in an approved Roblox Studio environment by this website.
A checked checklist records your own review, not automated project competence or a community verification.
An event announces something that happened. prompt.Triggered:Connect(callback) registers a callback; it does not immediately call that callback.
Triggered supplies the Player who used the prompt. Use that parameter rather than guessing which player interacted.
This first prompt prints a diagnostic only. Requests that change rewards or protected state need the validation taught in Chapter 11, even when a prompt appears to enforce distance.
Replace this code with the starter? Download your draft to keep a copy.
Edit and run these files in Roblox Studio. This browser has no Roblox services, physics, or replication.
Your output will appear here.
Sign in with RoCreators to save private progress across devices. Community verification is separate.