Add value definition||doc135543
September 20, 2022
Entity.addValueDef(key, init, toSelf, toOther, saveDB, client)
- The class to which the function belongs:
- Call limit:
Add a value definition, and the entity object automatically synchronizes with the saved attribute value definition.
- Often used with addValueFunc
- Usually, the operation of adding value definitions will be executed in the public global script, which can ensure that the attribute values of the server and the client are defined, so as to avoid the situation of undefined values during synchronization
- Note: The data store must be turned on to sync data to the database
|toSelf||boolean||Whether to synchronize to your own client|
|toOther||boolean||Whether to sync to other user clients|
|saveDB||boolean||Whether to save|
|client||boolean||Can the client make changes|
global script, add the value definition
Entity.addValueDef("score", 2, true, true, false, true) -- Note that "Entity" here can only be defined with this name / Note that "Entity" here can only be defined by that name
[BMGC] Copyright Infringement Claim Garena wholly respects the intellectual property rights of others and does not tolerate the infringement of these rights on our platform. As outlined in our Terms of Service, we will review reports of infringing content and remove content from our platform where necessary.
[BMGC] Creator Contest Rules Dear creators, you're invited to participate in the Blockman Creator Contest. This creator contest is organized across the globe and your game will be played by players from around the world! Submitted games will be evaluated in the Game Submission and Game Evaluation stages, and the winners will get attractive prizes. If you are interested in participating in this contest, please take note of the following contest rules and regulations.