루아(LUA)/로블록스
밟으면 색이 바뀌는 파트와 삼항연산_로블록스
JK77
2022. 3. 12. 05:07
local part = Instance.new("Part")
part.BrickColor = BrickColor.Red()
part.Position = Vector3.new(0, 0.5, -20)
part.Anchored = true
part.Parent = workspace
local debounce = false
local enabled = false
part.Touched:Connect(function(hit)
if not debounce then
debounce = true
enabled = not enabled
part.BrickColor = enabled and BrickColor.Green() or BrickColor.Red()
wait(.5)
debounce = false
end
end)