This would behave like the type function but it would support roblox types.
Changing the type function to do this isn’t a valid solution because old code relies on it returning userdata for roblox objects.
This is necessary when creating APIs because the vast majority of the time you want a very specific value type to be sent through your function, and if the value isn’t the right type everything breaks. By testing the type you can provide yourself with a verbose error about exactly what the problem is instead of waiting for the code to break.
I’m aware you can do this with pcall but that’s extremely slow and prone to breaking when roblox adds new types.
I suggest that it should support and identify these types, in addition to every type supported by the original type function:
Object - All roblox objects
Vector2
Vector2int16
Vector3
Vector3int16
Region3
Region3int16
Ray
CFrame
Enums - The Enum global
Enum - A specific enum (NormalId, InOut, KeyCode, etc)
EnumItem - A specific enum item (NormalId.Front, InOut.Out, KeyCode.Backspace, etc.)
Axes
BrickColor
Color3
Faces
UDim2
UDim
RBXScriptSignal
RBXScriptConnection
I don’t think I missed any