공부하는 Nar
article thumbnail
[디토랜드] Damage&Heal
LuaScript 2021. 12. 23. 11:35

ServerScript wait(2) --2초를 기다린 뒤, local Player = Game:GetAllPlayer()[1] --게임의 첫번째 플레이어를 얻어서 Player 변수에 할당해요. 더보기 예제 --게임의 모든 플레이어를 Game:GetAllPlayer()로 얻은 다음, --AllPlayer 변수에 할당해요. local AllPlayer = Game:GetAllPlayer() --반복문을 이용해서 AllPlayer 변수에 할당된 플레이어들의 이름을 print로 출력해요. --첫번째(i = 1)부터 시작해서, --AllPlayer의 크기(#AllPlayer)만큼 반복하고 --n번째 자식 오브젝트(AllPlayer[i])의 이름을 로그창에 출력해요. for i = 1, #AllPlayer do ..

article thumbnail
[디토랜드] GetCharacter&GetPlayer
LuaScript 2021. 12. 23. 10:07

ServerScript wait(2) --2초를 기다린 뒤, local Player = Game:GetAllPlayer()[1] --게임의 첫번째 플레이어를 얻어서 Player 변수에 할당해요. 더보기 예제 --게임의 모든 플레이어를 Game:GetAllPlayer()로 얻은 다음, --AllPlayer 변수에 할당해요. local AllPlayer = Game:GetAllPlayer() --반복문을 이용해서 AllPlayer 변수에 할당된 플레이어들의 이름을 print로 출력해요. --첫번째(i = 1)부터 시작해서, --AllPlayer의 크기(#AllPlayer)만큼 반복하고 --n번째 자식 오브젝트(AllPlayer[i])의 이름을 로그창에 출력해요. for i = 1, #AllPlayer do ..

article thumbnail
[디토랜드] Repeat - GetRemotePlayer, GetCharacter
LuaScript 2021. 12. 22. 15:31

ClientScript --로컬 플레이어를 Player 변수에 할당해요. local Player = LocalPlayer:GetRemotePlayer() 더보기 함수 RModeRemotePlayer GetRemotePlayer(string PlayerName) 이름으로 플레이어를 얻을 수 있어요. (찾고싶은 플레이어 이름) 샘플 local player = LocalPlayer:GetRemotePlayer() --자신의 플레이어를 반환해요. print("Wait Spawn Character") --조건(Player:GetCharacter())이 true가 될때까지 repeat 다음의 동작(wait)을 반복해요. --repeat의 조건이 true가 되어야 repeat 다음줄의 동작을 수행해요. repeat ..