Im trying this:
local itemName = GetItemInfo(241726);
But it's not working. It works with objects ids like , but  is a entity id, [Leystone Deposit]..
How can I get the name of the entity?
Thanks in advance!
Because Leystone Deposit is an item, if your client has never cached the item, it will return nil. Your code is correct, but missing registering the event GET_ITEM_INFO_RECEIVED.
Register for that event, calling your GetItemInfo. Cache the result yourself for future reference.