denoflions Posted February 22, 2016 Share Posted February 22, 2016 As the title says, how do I make an item that is right click usable from the inventory and does <something>? Here is a generic prefab item that does nothing to start with. local assets = { Asset("ANIM", "anim/test_kit.zip"), Asset("ATLAS", "images/inventoryimages/test_kit.xml"), Asset("IMAGE", "images/inventoryimages/test_kit.tex"), } local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("test_kit") inst.AnimState:SetBuild("test_kit") inst.AnimState:PlayAnimation("idle") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/test_kit.xml" MakeHauntableLaunch(inst) return inst end return Prefab("test_kit", fn, assets) How do I take this and make it a right-click use item that does some arbitrary function? Link to comment https://forums.kleientertainment.com/forums/topic/64611-how-to-make-an-item-right-click-use-from-inventory/ Share on other sites More sharing options...
Muche Posted February 22, 2016 Share Posted February 22, 2016 You might wanna look at INVENTORY component actions - Link to comment https://forums.kleientertainment.com/forums/topic/64611-how-to-make-an-item-right-click-use-from-inventory/#findComment-725294 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