v3 · Activity 9 of 12 · or · and · not · boundaries · 11 min Learning simulation
A visitor can enter by either route: reaching the required level or holding a pass. >= includes the exact level boundary; or accepts either true condition.
The browser checks a returned boolean for different visitors. This Learning simulation is not a running Roblox experience or a multiplayer security system.
Implement canEnter(playerLevel, requiredLevel, hasPass). Return a boolean: allow a visitor at or above the required level, or a visitor with a pass. Keep the final return canEnter so the checker can try the visible cases and additional boundaries. This is a Learning simulation, not a Roblox gate.
Interface: canEnter(playerLevel, requiredLevel, hasPass) -> boolean
| Input | Expected |
|---|---|
Level 4, requirement 5, no pass4, 5, false | false |
Level 5, requirement 5, no pass5, 5, false | true |
Level 7, requirement 5, no pass7, 5, false | true |
Level 2, requirement 5, pass2, 5, true | true |
local function canUseBench(hasReservation, isOpenDay)
return hasReservation or isOpenDay
end
return canUseBenchA reservation and an open day are alternative routes. No reservation on an open day still permits use.
New syntax: or, and, not
The rule is: a visitor reaches the required level OR has a pass. The level route includes equality, so it needs >=. The pass is another route, not an extra requirement.
or succeeds when either condition is true. and would require both. not reverses truthiness; not hasPass describes a visitor without a pass.
The gate picture is labeled Learning simulation. It reads the actual evaluated return value. It is not a Roblox server, and its access logic alone does not implement secure multiplayer permissions.
Try every visible case. The starter passes a visitor above the requirement but fails equal-level visitors and low-level visitors with a pass. Passing one example is not enough.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
canEnterplayerLevel, requiredLevel, hasPass
playerLevel requiredLevel
canEnterThis is a private experiment copy. It does not replace your answer or complete the activity.
These inputs apply when your scratchpad returns the function described by the activity interface.
Your output will appear here.
Replace this code with the starter? Download your draft to keep a copy.
Your output will appear here.
Sign in with RoCreators to save private progress across devices. Community verification is separate.