Character:sync - brianhang/nutscript2 GitHub Wiki
Description
Character:sync(recipient, ignorePrivacy)
This server function networks the character's information to recipient. Note that certain variables may not be sent. This is determined by the character variables themselves.
Synchronizing a character is when a character object is first made on the client, so you should synchronize a character when it is created on the server. For example, you should synchronize the character when loading a character or creating a new character.
Parameters
| Name | Description |
|---|---|
recipient |
Who receives the character information. If this is a table, then Players inside the table will receive the information. If this is a Player, then only that player will receive the information. Otherwise, everyone receives the character's information. |
ignorePrivacy |
If true, then privacy for the variables are ignored. So, all variables for the character are networked to the given recipient. |
Side Effects
- Character information is networked to player(s).
- The CharacterSync hook is called after the variables have been synchronized.