> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getscripthash

> Roblox script object の stored bytecode string に対する uppercase SHA384 hex digest を返します。argument は object である必要があります。共有 bytecode reader は ClassName 値 ModuleScript、LocalScript、CoreScript、Script を受け付けます。Script では RunContext が Client である必要があります。ClassName がない場合、function は "Invalid Instance" を投げます。ClassName が対応する script classes のいずれでもない場合、"Script expected" を投げます。値が別の RunContext を持つ Script の場合、"Expected a Script with RunContext set to Client" を投げます。embedded bytecode reference が無効、または stored bytecode の長さが 8 bytes 以下の場合、function は nil を返します。それ以外では、正確な stored bytecode bytes を SHA384 で hash し、uppercase hex string を返します。function は DecompressBytecode を呼び出さず、decompressed bytecode を hash しません。

<div className="real-function-page">
  ```lua theme={null}
  getscripthash(script: userdata): string | nil
  ```

  ## 引数

  <ParamField path={"script"} type={"userdata"} required>
    Hash する Script object。対応する ClassName 値は ModuleScript、LocalScript、CoreScript、RunContext Client の Script です。
  </ParamField>

  ## 戻り値

  <ResponseField name={"hash"} type={"string | nil"}>
    stored bytecode bytes の uppercase SHA384 hex digest、または利用可能な embedded bytecode がない場合は nil。
  </ResponseField>

  ## 例

  Hash the bytecode of a supported Roblox script Instance when bytecode is available.

  ```lua theme={null}
  local targetScript

  for _, descendant in ipairs(game:GetDescendants()) do
      if descendant:IsA("LuaSourceContainer") then
          targetScript = descendant
          break
      end
  end

  if targetScript then
      local hash = getscripthash(targetScript)
      print(hash)
  end
  ```
</div>
