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 https://forums.kleientertainment.com/forums/topic/51875-i-had-a-problem-in-mod-making/ 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 https://forums.kleientertainment.com/forums/topic/51875-i-had-a-problem-in-mod-making/#findComment-620369 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now