본문 바로가기

Roblox Script

#3 - 무한 반복 블록 생성

스크립트로 블록을 무한히 생성해봅시다!
하늘에서 다양한 블록이 떨어집니다.
4줄이면 블록을 만들 수 있어요.


print("Create Blocks")
local function create_ball()
     ball = Instance.new("Part",workspace)
     ball.Shape = "Ball"
     ball.Position = Vector3.new(math.random(-100,100), 100, math.random(-100,100))
     ball.BrickColor = BrickColor.Random()
end

local function create_block()
     ball = Instance.new("Part",workspace)
     ball.Position = Vector3.new(math.random(-100,100), 100, math.random(-100,100))
     ball.BrickColor = BrickColor.Random()
end

while (true) do
     create_ball()
     create_block()
     wait(0.5)
end