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

> Zwraca uppercase SHA384 hex digest dla stored bytecode string z Roblox script object. Argument musi byc object. Wspolny helper GetBytecode akceptuje wartosci ClassName ModuleScript, LocalScript, CoreScript i Script. Dla Script, RunContext musi byc Client. Jesli brakuje ClassName, function rzuca "Invalid Instance". Jesli ClassName nie jest jedna z obslugiwanych script classes, rzuca "Script expected". Jesli wartosc jest Script z innym RunContext, rzuca "Expected a Script with RunContext set to Client". Jesli embedded bytecode reference jest nieprawidlowy albo dlugosc stored bytecode wynosi 8 bytes lub mniej, function zwraca nil. W przeciwnym razie hashuje dokladne stored bytecode bytes przez SHA384 i zwraca uppercase hex string. Function nie wywoluje DecompressBytecode i nie hashuje decompressed bytecode.

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

  ## Argumenty

  <ParamField path={"script"} type={"userdata"} required>
    Script object do zahashowania. Obslugiwane wartosci ClassName to ModuleScript, LocalScript, CoreScript oraz Script z RunContext Client.
  </ParamField>

  ## Zwroty

  <ResponseField name={"hash"} type={"string | nil"}>
    Uppercase SHA384 hex digest z stored bytecode bytes, albo nil gdy nie ma uzywalnego embedded bytecode.
  </ResponseField>

  ## Przykład

  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>
