> ## 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

> ส่งคืน uppercase SHA384 hex digest สำหรับ stored bytecode string ของ Roblox script object โดย argument ต้องเป็น object helper ร่วม GetBytecode รับค่า ClassName เป็น ModuleScript, LocalScript, CoreScript และ Script สำหรับ Script นั้น RunContext ต้องเป็น Client หากไม่มี ClassName function จะ throw "Invalid Instance" หาก ClassName ไม่ใช่ script classes ที่รองรับ จะ throw "Script expected" หากค่าเป็น Script ที่มี RunContext อื่น จะ throw "Expected a Script with RunContext set to Client" หาก embedded bytecode reference ไม่ถูกต้องหรือความยาว stored bytecode เป็น 8 bytes หรือน้อยกว่า function จะคืน nil ไม่เช่นนั้นจะ hash stored bytecode bytes ที่ตรงจริงด้วย SHA384 แล้วคืน uppercase hex string function ไม่เรียก DecompressBytecode และไม่ hash decompressed bytecode

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

  ## Arguments

  <ParamField path={"script"} type={"userdata"} required>
    Script object ที่จะ hash ค่า ClassName ที่รองรับคือ ModuleScript, LocalScript, CoreScript และ Script ที่มี RunContext Client
  </ParamField>

  ## Returns

  <ResponseField name={"hash"} type={"string | nil"}>
    Uppercase SHA384 hex digest ของ stored bytecode bytes หรือ nil เมื่อไม่มี embedded bytecode ที่ใช้ได้
  </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>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.