Item

Item

클라이언트에서 사용되는 아이템 개체에요

함수

void Detach()

(deprecated) 플레이어 캐릭터에 붙어 있는 아이템을 해제할 수 있어요.

void AddAction(string ActionName, number ActionCoolTime, bool bActionWhileKeyDown, function ActionFunction, Key ActionKeys)

(deprecated) AddKeyAction 함수로 사용하세요.

void AddKeyAction(string ActionName, number ActionCoolTime, bool bActionWhileKeyDown, function ActionFunction, Key ActionKeys)

아이템을 착용 후 액션 추가해요. (액션 이름, 액션 실행 할 Enum.Key.키 , 해당 액션의 쿨타임, 자동 액션 여부, 연결 함수)

-- 샘플 --

local item = Script.Parent
local coolTime = 0
local isActionWhileKeyDown = true

local function StartClick(player, curCameraPos , curCameraForward) --클릭시 호출할 함수에요.
    print("Fire!")
end

local function EndClick(player, curCameraPos , curCameraForward) --클릭이 끝났을때 호출할 함수에요.
    print("End Click!")
end

item:AddAction("Fire", coolTime, isActionWhileKeyDown, StartClick, Enum.Key.LeftMouseButton) --아이템에 키 입력시 호출할 함수를 연결해요.
item:AddToggleAction("CheckAction", coolTime, StartClick, EndClick, Enum.Key.LeftMouseButton) --아이템에 착용 후 토글 액션을 추가해요.

void AddToggleAction(string ActionName, number ActionCoolTime, function StartFunction, function EndFunction, Key ActionKeys)

(deprecated) AddToggleKeyAction 함수로 사용하세요.

void AddToggleKeyAction(string ActionName, number ActionCoolTime, function StartFunction, function EndFunction, Key ActionKeys)

아이템 착용 후 토글 액션을 추가해요. (액션 이름, 액션 쿨타임, 액션 시작 시 연결 함수, 액션 종료 시 연결 함수)

-- 샘플 --

local item = Script.Parent
local coolTime = 0
local isActionWhileKeyDown = true

local function StartClick(player, curCameraPos , curCameraForward) --클릭시 호출할 함수에요.
    print("Fire!")
end

local function EndClick(player, curCameraPos , curCameraForward) --클릭이 끝났을때 호출할 함수에요.
    print("End Click!")
end

item:AddAction("Fire", coolTime, isActionWhileKeyDown, StartClick, Enum.Key.LeftMouseButton) --아이템에 키 입력시 호출할 함수를 연결해요.
item:AddToggleAction("CheckAction", coolTime, StartClick, EndClick, Enum.Key.LeftMouseButton) --아이템에 착용 후 토글 액션을 추가해요.

사용 가능한 부모 오브젝트 기능들

속성

이름

설명

객체 활성화 여부

객체의 Matrix

객체의 Local Transform

객체의 위치 Vector

객체의 로컬좌표 Vector

객체의 회전 Vector

객체의 로컬 회전 Vector

객체의 크기 Vector

객체의 가시성

이벤트

이름

설명

아이템 사용 시 호출되는 이벤트에요. 연결함수 형식은 function(usePlayer), usePlayer 는 Player 객체 입니다.

아이템 장착 시 호출되는 이벤트에요. 연결함수 형식은 function(equipPlayer), equipPlayer 는 Player 객체 입니다.

아이템 탈착 시 호출되는 이벤트에요. 연결함수 형식은 function(unequipPlayer), unequipPlayer 는 Player 객체 입니다.

생성 후 매 프레임마다 호출되는 이벤트에요. 연결함수 형식은 function(updateTime), updateTime 은 number 입니다.

삭제될 때 호출되는 이벤트에요. 연결함수 형식은 function() 입니다.

Enable 될때 호출되는 이벤트에요. 연결함수 형식은 function() 입니다.

Disable 될때 호출되는 이벤트에요. 연결함수 형식은 function() 입니다.

함수

이름

설명

아이템의 개수를 얻을 수 있어요.

현재 아이템 장착상태인지를 확인 할 수 있어요.

아이템에 설정한 해당 액션의 쿨타임을 얻을 수 있어요. (설정할 액션 이름)

아이템에 설정한 해당 액션의 쿨타임을 설정할 수 있어요. (설정할 액션 이름, 설정하고 싶은 시간)

해당 아이템의 장착 슬롯을 가져올 수 있어요.

아이템 착용 후 액션을 추가해요. (액션 이름, 해당 액션의 쿨타임, 연결 함수)

아이템 착용 후 토글 액션을 추가해요. (액션 이름, 액션 쿨타임, 액션 시작 시 연결 함수, 액션 종료 시 연결 함수)

객체의 키 값을 얻을 수 있어요.

현재 매트릭스에서 설정 된 매트릭스로 보간이 되는 매트릭스를 설정할 수 있어요 설정할 수 있어요. (Matrix 값, bool 충돌 처리 여부)

현재 매트릭스에서 설정 된 매트릭스로 보간이 되는 매트릭스를 로컬좌표기준으로 설정할 수 있어요 설정할 수 있어요. (Matrix 값, bool 충돌 처리 여부)

순간이동 하는 매트릭스를 설정할 수 있어요. (Matrix 값)

객체의 위치를 설정할 수 있어요. (설정할 위치 Vector 값, 충돌 처리 여부)

객체의 tag를 설정해요. (설정할 tag)

객체에 설정된 tag를 얻을 수 있어요.

유저가 추가한 오브젝트 커스텀 이벤트에 함수를 연결할 수 있어요. (이벤트 이름, 연결 함수)

오브젝트가 해당하는 위치를 바라보게 할 수 있어요. (바라볼 위치 Vector)

Last updated

Was this helpful?