Metadata Exports
RoadPhone Pro’s metadata system stores phone data directly on inventory items, enabling features like phone stealing and trading. These exports allow external resources to interact with phone metadata.Helper Functions
GetPhoneMetadataOnly
Get the complete metadata object for a player’s active phone.The player’s server ID.
The complete phone metadata table, or
nil if not found.This is a lightweight function that uses the active phone slot. Use this when you only need to read metadata without modifying it.
UpdatePhoneMetadataField
Update a single top-level field in phone metadata.The player’s server ID.
The metadata field name to update (e.g.,
'phone_background').The new value for the field. Use
nil to remove the field.true if successful, false otherwise.UpdatePhoneMetadataNested
Update a nested field within phone metadata.The player’s server ID.
The parent field name (e.g.,
'phone_settings').The child field name (e.g.,
'brightness').The new value for the nested field.
UpdatePhoneMetadataArray
Perform array operations (add/update/delete) on metadata arrays.The player’s server ID.
The array field name (e.g.,
'phone_contacts').The operation type:
'add', 'update', or 'delete'.For
'add'/'update': the item object. For 'delete': the ID value.The field name used as identifier (e.g.,
'id').Optional maximum array size (only for
'add' operations).Phone Number & Setup
GetPhoneNumberFromItem
Get the phone number from a player’s phone item.The player’s server ID.
Optional specific inventory slot to check.
Returns phone number, item name, slot number, and full metadata.
AssignPhoneNumberToItem
Assign a new phone number to a phone item.The player’s server ID.
The phone item name.
The inventory slot number.
Success status and the assigned phone number.
GetOrCreatePhoneNumber
Get the phone number for a player, creating one if necessary.The player’s server ID.
The phone number and whether it was newly created.
GetPhoneSetupFromItem
Check if the phone has completed initial setup.1 if setup is complete, 0 if setup is needed.UpdatePhoneSetup
Update the phone setup status.1 for complete, 0 for needs setup.Background & Settings
GetPhoneBackground
Get the phone’s wallpaper background.The background URL/path, or
nil if using default.UpdatePhoneBackground
Set the phone’s wallpaper background.The background URL/path, or
nil to reset to default.GetPhoneSettingsFromMetadata
Get all phone settings.Settings object with:
brightness, flightmode, large_app_icons, iconcolor, darkmode, timeCustomization.UpdatePhoneSettings
Update phone settings.Table with settings to update. Only provided keys will be changed.
PIN/Passcode
GetPhonePin
Get the phone’s PIN configuration.Table with
pin (string, 6 digits) and pin_needed (0 or 1).UpdatePhonePin
Update the phone’s PIN.The 6-digit PIN code, or
nil to remove.1 to require PIN on unlock, 0 to disable.Contacts
GetPhoneContacts
Get all contacts from the phone.Array of contact objects.
AddContactToMetadata
Add a new contact.Contact object with
id, name, number, and optional avatar.UpdateContactInMetadata
Update an existing contact.DeleteContactFromMetadata
Delete a contact.Notes
GetPhoneNotes
Get all notes from the phone.AddNoteToMetadata
Add a new note.Note object with
id, title, content, created_at.UpdateNoteInMetadata
Update an existing note.DeleteNoteFromMetadata
Delete a note.Photos
GetPhonePhotos
Get all photos from the phone.AddPhotoToMetadata
Add a new photo.Photo object with
id, url, created_at, and optional favorite.UpdatePhotoInMetadata
Update photo properties (e.g., favorite status).DeletePhotoFromMetadata
Delete a photo.Alarms
GetPhoneAlarms
Get all alarms from the phone.AddAlarmToMetadata
Add a new alarm.UpdateAlarmInMetadata
Update an existing alarm.DeleteAlarmFromMetadata
Delete an alarm.Messages
GetPhoneMessages
Get all messages from the phone.AddMessageToMetadata
Add a new message to the phone.MarkMessagesReadInMetadata
Mark messages from a specific number as read.Radio Channels
GetRadioChannelsFromMetadata
Get saved radio channels.AddRadioChannelToMetadata
Add a saved radio channel.UpdateRadioChannelInMetadata
Update a saved radio channel.DeleteRadioChannelFromMetadata
Delete a saved radio channel.GetRadioRecentFromMetadata
Get recent radio frequencies.AddRadioRecentToMetadata
Add a frequency to recent list.ClearRadioRecentFromMetadata
Clear all recent frequencies.Social Media Accounts
TweetWave
Backwards Compatibility: The old
*TwitterAccount* export names still work but are deprecated.Connect
RoadID Account
App Layout
GetPhoneAppsFromMetadata
Get installed apps and homescreen layout.Object with
installed (array of app IDs) and homescreen (layout data).UpdateInstalledApps
Update the list of installed apps.UpdateHomescreenLayout
Update the homescreen layout (pages and dock).Backup System
Backup functions require
Config.BackupEnabled = true in the configuration.CreatePhoneBackup
Create a backup of all phone data.Optional custom name for the backup. Defaults to timestamp.
'manual' or 'auto'. Defaults to 'manual'.GetPhoneBackups
Get all backups for the player.Array of backup objects with
backup_id, backup_name, created_at, backup_type.RestorePhoneBackup
Restore phone data from a backup.The UUID of the backup to restore.
DeletePhoneBackup
Delete a backup.Metadata Limits
Phone metadata has built-in limits to prevent inventory bloat:| Data Type | Limit |
|---|---|
| Messages | 300 |
| Contacts | 200 |
| Notes | 150 |
| Photos | 150 |
| Alarms | 30 |
| Radio Channels | 30 |