xzl2021 Posted March 9, 2015 Share Posted March 9, 2015 I made a mod has a function about inventory,but I dont know how to achieve this goal : e.g. When I put my mouse cursor on the second slot of inventory,how to renturn or get the value '2' ? When I put the third slot,return value '3' ? I have tried using function GetPlayer().components.inventory:GetSlotNum() But the game tell me 'inventory' is a nil value. Please help me,thanks. Link to comment Share on other sites More sharing options...
Blueberrys Posted March 9, 2015 Share Posted March 9, 2015 @xzl2021 Are you modding for DST? I believe it uses a different approach in accessing components. Also, GetSlotNum is a function of the inventoryitem component, not the inventory component. Try usingTheInput:GetHUDEntityUnderMouse() orTheInput:GetAllEntitiesUnderMouse() I'm not sure if either of them will work for inventory items, though. Then to get the slot number, useitem_instance.components.inventoryitem:GetSlotNum() Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.