공부하는 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
[디토랜드] GetAllPlayer
LuaScript 2021. 12. 23. 10:28

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