BoolValue is a networked boolean variable that automatically synchronizes across all players in your world. When you change a BoolValue on the server, all connected clients are automatically notified of the new value.
Common uses:
- Game state flags (isGameStarted, isRoundActive)
- Feature toggles (isDoorOpen, isEventRunning)
- Player-specific states (isPlayerReady, hasCompletedTutorial)
How it works:
- Server changes the value using: boolValue.value = true
- All clients automatically receive the update
- Clients listen for changes using: boolValue.Changed:Connect(function(newVal, oldVal) ... end)
IMPORTANT Rules:
- ALWAYS change values on SERVER side only (changing on client won't sync to others)
- Connect to Changed event on CLIENT side to react to updates
- Each BoolValue needs a unique name within your script
Player-specific vs Global:
- Global: Use for world-wide states (isNightTime, isStoreOpen) - one value for everyone
- Player-specific: Use for per-player states (isPlayerReady) - separate value for each player Pass player object in constructor OR append player.id to name
Properties
Represents the synchronized boolean value. Changes trigger notifications across clients via the Value.Changed event.
local isActive = BoolValue.new("IsActive", false)
isActive.value = true -- Syncs to all clients
if isActive.value then
print("System is active")
end
Updated 19 days ago