[source] | guide_examples [title] | 타이머 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=821 [code] | Property: [None] Entity CardPairGameUI = /ui/CardPairGameUI [None] number PlayTime = 60 [None] number RemainingTime = 0 Method: [client only] void OnBeginPlay() { self:StartGame() } [client only] void StartGame() { self.CardPairGameUI.Enable = true self.RemainingTime = self.PlayTi
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local a = 1 log(type(a)) -- number a = 1234.5678 log(type(a)) -- number a = "hello" log(type(a)) -- string a = (0 > 10) log(type(a)) -- boolean a= nil log(type(a)) -- nil a = {} log(type(a)) -- table a = {"Lua", "Test"} log(type(a)) -- table
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local table = {}
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local testArray = {"A string", 1.234, self.Enable}
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local testArray = {"A string", 1.234, self.Enable} log(testArray[1]) -- A string log(testArray[2]) -- 1.234 log(testArray[3]) -- true
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local testArray = {11, 22, 33} testArray[2] = "bb" testArray[4] = "44" log(testArray[2]) -- bb log(testArray[3]) -- 33 log(testArray[4]) -- 44
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local testArray = {"A", 1.234} table.insert(testArray, "C") testArray[#testArray+1] = "D" log(testArray[3]) -- C log(testArray[4]) -- D
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local testArray = {"A", "B"} -- 2번 인덱스에 "and"를 추가 table.insert(testArray, 2, "and") log(testArray[1]) -- A log(testArray[2]) -- and log(testArray[3]) -- B
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local array = {11, 22, 33, 44, 55} -- 1번 인덱스를 제거 table.remove(array, 1) log(array[1]) -- 22
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local myDictionary = {a = "myNumber", myNumber = 5, myString = "TTT", myBoolean = true}
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local myDictionary = {a = "myNumber", myNumber = 5, myString = "TTT", myBoolean = true} log(myDictionary.myNumber) -- 5 log(myDictionary.myString) -- TTT log(myDictionary["myBoolean"]) -- true
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local myDictionary = {name = "Tom", age = 20} -- 값 변경 myDictionary.name = "Katy" myDictionary.age = 25 -- Key - Value 추가 myDictionary.favoriteGame = "MapleStory Worlds" log(myDictionary.name) -- Katy log(myDictionary.age) -- 25 log(myDictionary.favoriteGame) -- MapleStory Worlds
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local myDictionary = {name = "Tom", age = 30, favoriteGame = "MapleStory Worlds", job = "Programmer"} -- Key - Value 삭제 myDictionary.job = nil -- myDictionary 전체를 순회하며 key, value를 출력 for key, value in pairs(myDictionary) do log(key, value) end -- [[결과 : age 30 name Tom favoriteGame MapleStory
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local original = {10, 100, 1000} local reference = original log(reference[1], reference[2], reference[3]) -- 10, 100, 1000 -- 원본 값 수정 original[1] = "A" original[2] = "B" log(reference[1], reference[2], reference[3]) -- A, B, 1000
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | log(1 + 1) -- 2 log(1 - 1) -- 0 log(5 * 5) -- 25 log(13 / 5) -- 2.6 log(13 // 5) -- 2 log(13 % 5) -- 3 log(2 ^ 4) -- 16.0
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local a = 1 local b = 2 log(a == b) -- false log(a ~= b) -- true log(a > b) -- false log(a < b) -- true log(a >= b) -- false log(a <= b) -- true
[source] | guide_examples [title] | 메이플스토리 월드 루아 기초 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=822 [code] | local a = {"HELLO", "MapleStory Worlds"} log(#a) -- 2 log(a[1].."! "..a[2]) -- HELLO! MapleStory Worlds
[source] | guide_examples [title] | 점수 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=823 [code] | Property: [None] number Score = 0 Method: void AddScore (number add) { self.Score = self.Score + add }
[source] | guide_examples [title] | 점수 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=823 [code] | Property: [None] Entity CardSpawnRoot = /ui/CardPairGameUI/UI_Board/UI_Blocks/UI_Block_Group [None] Card SelectedCard = nil [None] Entity TimeText = /ui/CardPairGameUI/UI_Board/Background/Title/Timer_Background/UI_Time/UI_Time_Text [None] Entity ScoreText = /ui/CardPairGameUI/UI_Board/Background/Tit
[source] | guide_examples [title] | 점수 만들기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=823 [code] | Property: [None] Entity CardPairGameUI = /ui/CardPairGameUI [None] number PlayTime = 60 [None] number RemainingTime = 0 Method: [client only] void OnBeginPlay() { self:StartGame() } [client only] void StartGame() { self.CardPairGameUI.Enable = true self.RemainingTime = self.PlayTi
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type string local testValue = "test"
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | local function TestFunction() return "strValue" end local strValue = TestFunction()
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | local function TestFunction() return "strValue", 5 end local strValue, intValue = TestFunction()
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type TYPE
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type string local testValue = "test"
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type string, integer local strValue, intValue = "str", 5
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type table<KEY_TYPE, VALUE_TYPE>
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type table local testTable = {}
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type table<Entity> local testTable = {}
[source] | guide_examples [title] | 어노테이션 활용하기 [page] | https://maplestoryworlds-creators.nexon.com/ko/docs?postId=824 [code] | ---@type table<string, Entity> local testTable = {}