
-- Place this code in a LocalScript within a TextLabel/TextButton
local textLabel = script.Parent
-- Some colors we'll use with TextColor3
local colorNormal = Color3.new(0, 0, 0) -- black
local colorSoon = Color3.new(1, .5, .5) -- red
local colorDone = Color3.new(.5, 1, .5) -- green
-- Loop infinitely
while true do
-- Count backwards from 10 to 1
for i = 10, 1, -1 do
-- Set the text
textLabel.Text = "Time: " .. i
-- Set the color based on how much time is left
if i > 3 then
textLabel.TextColor3 = colorNormal
else
textLabel.TextColor3 = colorSoon
end
wait(1)
end
textLabel.Text = "GO!"
textLabel.TextColor3 = colorDone
wait(2)
end
'루아(LUA) > 로블록스' 카테고리의 다른 글
시간의 흐름에 따라 파트의 메테리얼 속성 바꾸기 [로블록스 1일 1코딩 #6] (0) | 2022.01.23 |
---|---|
Instance.new, AncestryChanged [1일 1코딩 #3] (0) | 2022.01.20 |
블렌더에서 만든 캐릭터 로블록스로 옮기기 [로블록스 개발일지#3] (0) | 2022.01.18 |
로블록스 캐릭터 만들기 [개발일지#2] (0) | 2022.01.18 |
로블록스 게임 복사하기 [개발일지#1] (0) | 2022.01.17 |