脚本

getscripthash

当字节码可用时,返回脚本的稳定哈希值。

语法

getscripthash(script: userdata): string | nil

参数

名称类型描述
scriptuserdata要检查的脚本或 ModuleScript 实例。

返回值

名称类型描述
hashstring | nil哈希字符串,或者当哈希不可用时为 nil。

说明

当字节码可用时,返回脚本的稳定哈希值。

使用 1 个参数调用: script。参数表会说明哪些值必填,哪些值只用于细化行为。

返回 hash (string | nil)。使用返回表区分成功值、nil 结果和可恢复错误。

示例

使用占位值的示例调用。

local result = getscripthash(game)
print(result)