문법
hookfunction(target: function, replacement: function): function별칭
hookfuncreplaceclosuredetourfunctiondetour_function인수
| 이름 | 타입 | 설명 |
|---|---|---|
target | function | 검사 또는 변경 중인 대상 함수, 테이블, 스택 수준 또는 개체입니다. |
replacement | function | 설치해야 하는 대체 값 또는 기능입니다. |
반환값
| 이름 | 타입 | 설명 |
|---|---|---|
original | function | 교체되기 전의 원래 기능입니다. |
설명
대상 함수를 대체 함수로 바꾸고 원래 함수를 반환합니다.
2개 파라미터로 호출합니다: target, replacement. 인수 표는 필수 값과 동작을 조정하는 값을 설명합니다.
original (function)을 반환합니다. 반환 표를 사용해 성공 값, nil 결과, 복구 가능한 오류를 구분하세요.
예제
자리 표시자 값을 사용하는 예제 호출입니다.
local result = hookfunction(function() end, function() end)
print(result)