Draft preview · this lesson is still being technically validated. Browser experiments and reference material remain available; trusted completion is enabled after publication.
Send a narrow client request
v2 · Activity 1 of 0 · remoteevent · communication · 28 min Requires Roblox Studio
Chapter outline
RemoteEvent crosses the client/server boundary asynchronously. FireServer sends a client request; OnServerEvent receives the real sending Player as its first argument. The remaining payload is untrusted.
FireClient sends feedback to a particular Player. A reply to one requester should not broadcast another player’s private information.
Your task
Create InspectRequest and InspectFeedback RemoteEvents. A client button sends inspect. The server validates the action, rate-limits it, and replies Inspection acknowledged only to that sender.
Interface: Complete the documented Studio hierarchy and self-check the behavior outside the browser.
| Input | Expected |
|---|
Syntax in this activity
New syntax: remoteevent, communication
Earlier ideas used here
- script-locations
- execution-context
- client-server
- replication
- authority
- events
- connections
- input
- contextactionservice
- accessibility
Self-check rubric
- A valid action receives per-client feedback.
- Unknown strings and table payloads get no acknowledgement.
- Rapid repeated requests are bounded by the server cooldown.
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.
Build this hierarchy
ReplicatedStorage/InspectRequest (RemoteEvent) ReplicatedStorage/InspectFeedback (RemoteEvent) ServerScriptService/InspectServer (Script, RunContext=Server) StarterGui/InspectGui (ScreenGui) InspectButton (TextButton) Status (TextLabel) InspectClient (LocalScript)
- Create both shared remotes and the readable GUI hierarchy.
- Set the button text to Inspect and give it a 200x52 touch target.
ServerScriptService/InspectServer.server.luau
Server validates and replies narrowly.
local Players = game:GetService("Players")
local storage = game:GetService("ReplicatedStorage")
local request = storage:WaitForChild("InspectRequest")
local feedback = storage:WaitForChild("InspectFeedback")
local nextAllowed = {}
request.OnServerEvent:Connect(function(player, action)
local now = os.clock()
if now < (nextAllowed[player.UserId] or 0) then return end
nextAllowed[player.UserId] = now + 1
if type(action) ~= "string" or action ~= "inspect" then return end
feedback:FireClient(player, "Inspection acknowledged")
end)
Players.PlayerRemoving:Connect(function(player) nextAllowed[player.UserId] = nil end)StarterGui/InspectGui/InspectClient.client.luau
Client request and local response display.
local storage = game:GetService("ReplicatedStorage")
local request = storage:WaitForChild("InspectRequest")
local feedback = storage:WaitForChild("InspectFeedback")
script.Parent.InspectButton.Activated:Connect(function() request:FireServer("inspect") end)
feedback.OnClientEvent:Connect(function(message) script.Parent.Status.Text = message end)Expected output
- The requesting client sees Inspection acknowledged.
- The other client receives no reply for someone else’s request.
Studio assessment checklist
Multiplayer tests
- Run two clients and verify isolated feedback.
- Use controlled local client code to send unknown actions and repeated requests.
Troubleshooting and production considerations
OnServerEvent is connected on the server; OnClientEvent on the client.
A response RemoteEvent must be replicated so the client can receive it.
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.
Create InspectRequest and InspectFeedback RemoteEvents. A client button sends inspect. The server validates the action, rate-limits it, and replies Inspection acknowledged only to that sender.
Reset starter
Replace this code with the starter? Download your draft to keep a copy.
Code
Studio source fileEdit 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.