Object.ID
From Liberty Unleashed Wiki
This Object class member returns the ID of the given object.
Syntax
Integer object.ID
Example
This will create a new object and return it's ID when a player types '/object'
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "object" ) { local pPos = pPlayer.Pos, pObject; pObject = CreateObject( 1378, pPos.x - 5, pPos.y, pPos.z ); if ( pObject ) MessagePlayer( "Object created with ID " + pObject.ID, pPlayer ); } return 1; }
Notes
The functions MessagePlayer and Player.Pos and CreateObject and event onPlayerCommand were used in this example. More info about them in the corresponding pages.