You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To assign an `Datatype.EnumItem` as the value of a property, use the full `Datatype.Enum` declaration. You can also use its `Value` or `EnumType`.
49
-
50
-
<Alertseverity="warning">
51
-
Assigning `Datatype.EnumItem` properties like `Class.Part.Shape|Shape` to the `DataType.EnumItem.Value|Value` property is bad practice, as the `DataType.EnumItem.Value|Value` property can be moved around if a new `Datatype.EnumItem` is added to the `Enum.PartType` enum.
52
-
Meaning your code may break if you rely on assigning `Datatype.EnumItem` via their `DataType.EnumItem.Value|Value`.
53
-
</Alert>
48
+
To assign an `Datatype.EnumItem` as the value of a property, use the full `Datatype.Enum` declaration. You can also use its `Datatype.EnumItem.Name|Name`.
54
49
55
50
```lua
56
51
localWorkspace=game:GetService("Workspace")
57
52
58
-
localpart=Instance.new("Part")-- Create a new part
53
+
localpart=Instance.new("Part")-- Create a new part
59
54
part.Shape=Enum.PartType.Cylinder-- By EnumItem (best practice)
60
-
part.Shape=Enum.PartType.Cylinder.Value-- By EnumItem Value
61
-
part.Shape=2-- By EnumItem Value
62
55
part.Shape=Enum.PartType.Cylinder.Name-- By EnumItem Name
0 commit comments