1. Make sure the **Models** sorting is selected, then click the **See All** button for **Categories**.
1. Locate and click the **Packages** tile.
1. Locate the **Photo Booth** module and click it, or drag-and-drop it into the 3D view.
1. Move it into the top-level **Workspace** hierarchy and position it where desired.
1. Paste the following code into the new script.
```lua title="LocalScript - ConfigurePhotoBooth"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotoBooth = require(ReplicatedStorage.PhotoBooth)
PhotoBooth.configure({
frameMessage = "First Photo Booth Capture!",
})
```
### Connect to events
Every time the photo booth displays a new screen to a local client, a corresponding event is fired. These events can be connected in a `Class.LocalScript` so that you can respond with your own custom logic.
```lua title="LocalScript"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotoBooth = require(ReplicatedStorage.PhotoBooth)
PhotoBooth.countdownStarted:Connect(function()
print("The countdown has started")
end)
PhotoBooth.printoutShown:Connect(function()
print("The printout is showing")
end)
PhotoBooth.promptShown:Connect(function()
print("The camera prompt is showing")
end)
```
### GUI visibility
By default, the photo booth hides all `Class.ScreenGui|ScreenGuis` and `Class.CoreGui|CoreGuis` when a photo is staged. If you want to override this auto-hiding behavior and programmatically decide which GUIs should remain visible, include the [hideOtherGuis](#hideotherguis) and [showOtherGuis](#showotherguis) callbacks and respond with your own custom logic.
```lua title="LocalScript"
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local PhotoBooth = require(ReplicatedStorage.PhotoBooth)
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local hiddenInstances = {}
-- Create a screen GUI that will not be hidden
local specialGuiInstance = Instance.new("ScreenGui")
-- Draw the screen GUI above the photo booth GUI
specialGuiInstance.DisplayOrder = 1
specialGuiInstance.Parent = playerGui
-- Set attribute on screen GUI to prevent hiding
specialGuiInstance:SetAttribute("ShowInPhotoBooth", true)
-- Add text label to the GUI
local specialLabel = Instance.new("TextLabel")
specialLabel.Size = UDim2.fromScale(1, 0.1)
specialLabel.Text = "Remains visible when taking a photo"
specialLabel.Font = Enum.Font.GothamMedium
specialLabel.TextSize = 24
specialLabel.Parent = specialGuiInstance
PhotoBooth.hideOtherGuis(function()
-- Hide all developer-defined screen GUIs except those marked with attribute
local instances = playerGui:GetChildren()
for _, instance in instances do
if instance:IsA("ScreenGui") and not instance:GetAttribute("ShowInPhotoBooth") and instance.Enabled then
instance.Enabled = false
table.insert(hiddenInstances, instance)
end
end
-- Hide specific core GUIs
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end)
PhotoBooth.showOtherGuis(function()
-- Show all developer-defined screen GUIs that were hidden
for _, instance in hiddenInstances do
instance.Enabled = true
end
hiddenInstances = {}
-- Show specific core GUIs that were hidden
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
end)
```
## API reference
### Functions
#### configure
| Key | Description | Default |
|---|---|---|
| `frameMessage` | Message that is shown at the bottom of the photo. Its duration can be controlled via the `fadeUiDelay` property. | "Use your device to take a screenshot and share!" |
| `fadeUiDelay` | Time to show the frame message before it fades out, in seconds. Set to a negative number to never fade. | 3 |
| `closeButtonImage` | Image to use for the close photo button, placed overtop the `closeButtonBackgroundImage` image. | "rbxassetid://7027440823" |
| `closeButtonBackgroundImage` | Background image to use for the close photo button. | "rbxassetid://7027440891" |
| `cameraLandscapePosition` | Distance of the photo booth's camera, in front and upward from the character, when taking a photo in landscape mode (`Datatype.Vector2`). | (5, 2) |
| `cameraPortraitPosition` | Distance of the photo booth's camera, in front and upward from the character, when taking a photo in portrait mode (`Datatype.Vector2`). | (10, 1) |
| `countdownFont` | Font to use for the numbers in the countdown (`Enum.Font`). | `Enum.Font|GothamBlack` |
| `countdownTextColor` | Color of the numbers in the countdown (`Datatype.Color3`). | [255, 255, 255] |
| `printoutCharacterPosition` | Position of the character on the screen when the printout is showing (`Datatype.UDim2`). | (0.5, 0, 0.5, 0) |
| `printoutCharacterSize` | Amount of screen space the character takes up in the printout (`Datatype.UDim2`). | (1, 0, 1, 0) |
| `characterAnimation` | Asset ID of the animation the character takes in the photo, paused at its starting frame. | "rbxassetid://6899663224" |
| `filterImage` | Image to apply over the photo as a filter. If `nil`, a default filter that darkens the image edges will be used. | `nil` |
| Key | Description | Default |
|---|---|---|
| `maxActivationDistance` | Maximum distance, in studs, a player's character can be from the photo booth for the prompt to appear. | 10 |
| `countdownBeepSound` | Asset ID of the `Class.Sound` to play for each number shown in the countdown. | "rbxassetid://7743999789" |
| `countdownFlashSound` | Asset ID for the `Class.Sound` to play when the flash effect is shown. | "rbxassetid://7744000850" |
| `countdownSeconds` | Number of seconds to count down for. | 3 |
| `photoboothTag` | Tag used by `Class.CollectionService` to find all "booths" in the place. | "PhotoBooth" |