Lua 프로그래밍

프로그래밍은 컴퓨터에게 단계별 지시를 내리는 것과 같습니다. 마치 친구에게 레고 집을 만드는 방법을 설명하는 것처럼, 컴퓨터가 실행할 코드를 작성합니다. Roblox Studio에서는 Lua 프로그래밍 언어를 사용하여 게임을 만들고 아이디어를 실현할 수 있습니다. Lua는 간단하면서도 강력하여 초보자에게 적합합니다.

"Hello, world!"

function sayHello()
  print("Hello, world!")
end

Variables (변수)

local message = "Hello, Roblox!" 
print(message)
nila = nil
booleanb = true
numbern = 1
strings = 'abc'
tablet = {a, b, c}
functionfoo = function(x) return 2*x end
userdatau = some_C_struct
threadco = coroutine.create( function () print('hi') end )

Strings in Lua (Lua의 문자열)

local greeting = "Hello" 
local name = "Roblox" 
print(greeting .. ", " .. name)

Combining Numbers and Strings (숫자와 문자열 결합)

local age = 10 
print("I am " .. age .. " years old")

Basic Arithmetic Operations (기본 산술 연산)

local x = 10 
local y = 20
print(x + y)
local a = 5 
local b = 3 
print(a * b)

Conditions (조건문)

local number = 10 
if number > 5 then  
   print("Number is greater than 5") 
else 
   print("Number is 5 or less") end

Loops (반복문)

for i = 1, 5 do 
   print("Iteration " .. i) 
end

Functions (함수)

function greet(name) 
   print("Hello, " .. name) 
end 
greet("Roblox")
greet("Game")

이 튜토리얼이 도움이 되셨다면, 저의 작업을 지원하기 위해 커피 한 잔을 사주시면 감사하겠습니다.

지원해 주셔서 정말 감사합니다!

커피 한 잔 사주기