BoolValue

사용되지 않는 항목 표시

An instance which is used to hold a boolean value. The value can be used for many things, including to communicate between scripts.

요약

속성

  • 병렬 읽기

    Used to hold a boolean value.

이벤트

속성

Value

병렬 읽기

Used to hold a boolean value.

메서드

이벤트

Changed

Fired whenever the BoolValue.Value of the BoolValue is changed. It will run with the new value being stored in the argument object, instead of a string representing the property being changed.

This event, like other changed events, can be used to track when an BoolValue changes and to track the different values that it may change to.

For instance, this may be useful in games that rely on BoolValues to track game states and values, such as switch or enabled states.

Equivalent changed events exist for similar objects, such as NumberValue and StringValue, depending on what object type best suits the need.

매개 변수

value: bool

The new value after the change.


코드 샘플

BoolValue.Changed

local boolValue = script.Parent.BoolValue
local function printValue(value)
print(value)
end
boolValue.Changed:Connect(printValue)
boolValue.Value = true