KV.Set(PlayIndex, Key, Value)

函数功能

设置目标玩家的指定属性值。
Key 已存在,则自动覆盖;若不存在,则自动添加。

操作参数

参数名 是否必须 类型 说明
PlayIndex int 玩家对象索引
Key string 属性名称
Value string / int / boolean / table(数组) 属性值

数组元素支持:整数、字符串、布尔、嵌套数组等。

返回值

操作示例

KV.Set(PlayIndex, "name", "战士")                 -- 字符串
KV.Set(PlayIndex, "level", 10)                   -- 整数
KV.Set(PlayIndex, "isVip", true)                 -- 布尔
KV.Set(PlayIndex, "skills", {"sword", "magic"})  -- 字符串数组
KV.Set(PlayIndex, "scores", {100, 200, 300})     -- 整数数组
作者:105493660  创建时间:2026-05-02 16:43
最后编辑:105493660  更新时间:2026-05-02 18:34