"> "> PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.

2 min

In Lua, nil is used to represent non-existence or nothingness. It’s frequently used to remove a value in a table or destroy a variable in a script. For instance:

In Roblox, nil can also be used to clear an Instance object’s Instance/Parent|Parent value and effectively remove it from the game, although it may be possible to bring the object back. Consider this example:

Tags:
  • lua
  • value
  • nil