CastLuau✎
Asserts a type for the typechecker. No runtime check: if you are wrong, it is wrong silently — use Is A to ask first. The Type pin takes any Luau type expression, so an intersection like `Model & { Humanoid: Humanoid }` is written here directly. Cast, in the Inspector, decides whether the assertion gets a line of its own; an implicit one inside the True arm of a Branch on Is A writes nothing at all, because Luau has already narrowed the value.
Pending review
- the language itself, so it works in Roblox and in Lune
- pure — no execution pins, wire it anywhere
- names its result — Result name in the Inspector is the local it binds, and a Declare Local reading that result makes a second one: see Variables and locals
Inputs
- Value:anymust be wired
- Type:string=
"BasePart"literalfrom a listOffers 682 values to pick from, and takes anything else typed in.
Outputs
- result:BasePart
What it compiles to
luau
print((value :: BasePart))
Warning
Type is typed in directly and pasted into the generated source, so it cannot be wired from a value. The editor refuses the connection rather than letting it fail at compile time.
Not reviewed yet