> For the complete documentation index, see [llms.txt](https://ans-dev.gitbook.io/datareplicator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ans-dev.gitbook.io/datareplicator/api-reference/server-side-api/create.md).

# :Create

Creates a new, replicated data entry on the server. Once created, this data can be requested or listened to by clients (subject to authorization).

If the key has not been pre-registered with [`:RegisterKey()`](/datareplicator/api-reference/server-side-api/registerkey.md), this function will also register it. Any options provided here will be locked in for the lifetime of the key.

***

**`DataReplicator:Create(realKey: string, data: any, options: table?)`**

***

{% tabs %}
{% tab title="Parameters" %}

* `realKey`: [string](https://create.roblox.com/docs/luau/strings)

  The unique, case-sensitive key for the data. Must not already exist.
* `data`: any

  The initial data to be stored. Can be any Roblox-serializable type.
* `options`: [table?](https://create.roblox.com/docs/luau/tables)

  An optional dictionary to configure advanced features for this data key.

  * `Encrypted`: [boolean](https://create.roblox.com/docs/luau/booleans) - (Default: `false`) If `true`, all data for this key will be protected by transport encryption. A unique session key is securely established for each player using a post-quantum key exchange. Best for sensitive information like currency or private settings.
  * `Priority`: [string](https://create.roblox.com/docs/luau/strings) - (Default: `"Medium"`) Sets the update priority. Can be `"High"`, `"Medium"`, or `"Low"`. Use `"High"` for critical gameplay data.
  * `UseDeltaCompression`: [boolean](https://create.roblox.com/docs/luau/booleans) - (Default: `false`) If `true`, only changes within a table will be replicated after the initial full sync. Highly recommended for large tables like inventories or skill trees to save network bandwidth.
    {% endtab %}

{% tab title="Returns" %}
[`boolean`](https://create.roblox.com/docs/luau/booleans) - `true` if the data was created successfully, or `false` if the key is invalid or already exists.
{% endtab %}

{% tab title="Example" %}
{% code title="CreateData.luau" %}

```lua
-- Example 1: Creating a simple, public data key for server announcements.
DataReplicator:Create("Public_ServerAnnouncements", "Welcome to the game!")


-- Example 2: Creating a complex, high-priority, and delta-compressed table for player data.
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local userId = player.UserId
	local playerDataKey = `PlayerData_{userId}`
	
	local initialData = {
		Level = 1,
		XP = 0,
		Gold = 100,
		Inventory = {},
		Stats = { Strength = 5, Agility = 5, Intellect = 5 }
	}
	
	local success = DataReplicator:Create(playerDataKey, initialData, {
		Priority = "High",
		UseDeltaCompression = true
	})
	
	if success then
		print(`Initial data created for player {userId}`)
	end
end)


-- Example 3: Creating a sensitive data key that will be encrypted.
local success = DataReplicator:Create("Private_GameSettings", { Volume = 0.5, Graphics = "High" }, {
	Encrypted = true
})

if success then
	print("Private, encrypted game settings have been created.")
end
```

{% endcode %}
{% endtab %}
{% endtabs %}
