typeof

Description

(DISCLAIMER: this is NOT for Roblox NOR is this the page for Luau's typeof function or luau API, have not realized how high this is in the typeof luau google search query lmao. This requires downloading Luanti as a prerequisite!)

As stated, provides functionality similar to the typeof function in Luau (the Lua dialect used by Roblox) - and is used in the same way!

Creates global function typeof which can be called with any value to figure out what specific complex type it is

typeof can return two values, the type and a subdivision if possible with the type (otherwise will return nil)

type, subdivision = typeof(value)

Certain types have subdivisions such as meta which can have node and itemstack

Current specified types:

vector, pseudovector, voxelarea, player, object, inventory, itemstack, areastore, voxelmanip, meta (subdivisions: node, itemstack, player, storage (mod storage)), itemdefinition (subdivisions: none, node, craft (a regular non-node item), tool), nodetimer, settings, number (subdivisions: float, integer)

The code loads certain values such as (its own) mod storage, getting meta from point 0,0,0, or getting areas of 0,0,0 to 1,1,1 as to grab their metatables for IDs. Certain types will not be available for classification prior to the finalized loading of mods due to engine limitations (such as node-specific or position-specific). Should be perfectly fine after load time. Last possible value to be loaded is the meta subdivision player - as it requires a player to join to get the metatable ID.

This function should NOT be considered a performance alternative to type(). This handles more complex types - and thusly has a slightly laggier approach - like Luau's typeof() does. It also uses type() a lot too - so it cannot be faster than it lol.

There is currently no difference between detached, node, and player inventories - and thusly there does not exist subdivisions of inventory.

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

1.2

Download

Luanti 5.0+

2025-08-24 00:15 UTC

/!\ Pseudovectors and Item Definitions 🔗

IT SHOULD BE NOTED:

All constructed vectors (e.g. v = {x=1,y=1,z=1} or any vectors made in clients prior to 5.5.0 will be noted as a pseudovector)

New types supported:

pseudovector

itemdefinition with subdivisions: none (e.g. hand), craft (regular item), node, tool

Subdivisions of itemdefinition will be the item definition's type field or "none" on failure

1.1.1

Download

Luanti 5.0+

2025-05-14 23:11 UTC

1.1.1 - minimal bug fixing 🔗

Like, hella minimal, I had wanted to stuff more into this but there isn't anything I see that I should change

Basically I just have it so it doesn't keep trying to get the metatable reference of a player's meta each time one joins - only doing the first that joins lol. I had forgotten to include it in the 1.1 release

1.0.1

Download

Luanti 5.0+

2025-05-09 16:50 UTC

1.0.1 - Trademark edit, fix compatibility issues with <5.5.0 🔗

As the title says! :D

1.0

Download

Luanti 5.5+

2025-05-09 15:37 UTC

1.0 - Initialization 🔗

Mod made! Gives developer a hopefully easier time with figuring out the different types that exist

All releases