语法
setfflag(name: string, value: any): boolean参数
| 名称 | 类型 | 描述 |
|---|---|---|
name | string | Exact fast flag name to set. |
value | any | Value to write. Accepted types depend on the detected flag type. |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
updated | boolean | true when a supported flag value was written, otherwise false. |
说明
Sets a Roblox fast flag by exact name. Accepted value types depend on the detected flag type. The function returns true after a supported write and false when the flag is missing, unsupported, or the value is not accepted.
使用 2 个参数调用: name, value。参数表会说明哪些值必填,哪些值只用于细化行为。
返回 updated (boolean)。使用返回表区分成功值、nil 结果和可恢复错误。
示例
Write a fast flag only after checking the flag type that Real detected for the exact name.
local flagName = "SomeFFlagName"
local flagType = getfflagtype(flagName)
if flagType == "bool" then
print(setfflag(flagName, true))
elseif flagType == "int" then
print(setfflag(flagName, 60))
elseif flagType == "string" then
print(setfflag(flagName, "Enabled"))
else
print(false)
end