Exports
How to call a Cobalt export and what the side tags mean.
Every Cobalt resource talks to the others through exports. Each page here covers one resource; cobalt_core is split by topic.
Calling an export
Call an export through the exports table, with the resource name and a colon:
local player = exports.cobalt_core:GetPlayer(source)
exports.cobalt_core:Notify(source, 'Payment received', 'success')The call yields while the other resource runs, then returns its values.
Sides
Each export carries a tag for where it exists:
| Tag | Callable from |
|---|---|
| Client | Client scripts only |
| Server | Server scripts only |
| Shared | Both, with the same arguments |
Some exports exist on both sides with different arguments, such as Notify, which takes a server id first on the server. Their pages list each side separately.
Reading a page
Each export shows its call, a parameter table, its return values and an example. Types in blue link to Types, which lists every named class and alias. Resources counts the exports per resource and lists the ones that have none.