getMeta()
Used to store cross-resource accessible information. This functionality stores an object on a player that can than be set with setMeta.
This type of meta is only accessible where it is created.
If it is created on the client-side it is only accessible on the client-side.
If it's created on the server-side it is only accessible on the server-side.
Function Definition
ts
public getMeta<V extends any>(key: string): V | undefined;
Arguments
- key: string
Returns
- V | undefined
Documentation
Examples
ts
const result = player.getMeta('myData');
if (!result) {
// Data does not exist
return;
}
console.log(result);