속성

Image 1
Image 2
Image 3
Roblox Studio

속성 변경 이벤트 청취

local part = script.Parent

local function updateColor()
    local status = part:GetAttribute("Status")
    if status == "Active" then
        part.Color = Color3.fromRGB(0, 255, 0)  -- Green
    elseif status == "Inactive" then
        part.Color = Color3.fromRGB(255, 0, 0)  -- Red
    elseif status == "Maintenance" then
        part.Color = Color3.fromRGB(0, 0, 255)  -- Blue
    else
        part.Color = Color3.fromRGB(255, 255, 255)  -- White
    end
end

updateColor()

part:GetAttributeChangedSignal("Status"):Connect(updateColor)

속성 설정

local part = script.Parent

part:SetAttribute("Status", "Active")
Image 1
Roblox Studio

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

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

커피 한 잔 사주기