본문 바로가기
루아(LUA)/로블록스

시간의 흐름에 따라 파트의 메테리얼 속성 바꾸기 [로블록스 1일 1코딩 #6]

by JK77 2022. 1. 23.
local timeControl = game.Lighting
local timeVal = 12

local brick = script.Parent

while true do
	timeControl.ClockTime = timeVal
	Wait(2)
	
	if timeVal == 25 then
		timeVal = 0
	end
	
	if timeVal > 18 then
		brick.Material = Enum.Material.Neon
	elseif timeVal < 7 then
		brick.Material = Enum.Material.Neon
	else brick.Material = "Plastic"	
	end
	
	timeVal += 1
	
end