CutestGirlHere Posted January 10, 2018 Share Posted January 10, 2018 I'm trying to make it so that my custom character on death will drop a special item. I know they already drop items in their inventory on death, but I'm trying to make it spawn an item and drop it when they die as well. I tried just taking the loot things from spiders and trying to just insert that in, and change around the items that'd drop. But that didn't really seem to work all too well and my character never dropped anything(aside from their inventory) on death. Fiddling with it didn't get many results either. So I'm wondering if this is actually possible, I imagine probably, but I'd like any sort of pointers on how to try and rig it up, since just trying to rip it out of enemies didn't work so well, and I'm still new to all of this stuff so I have no idea how to do it from scratch on my own. Link to comment Share on other sites More sharing options...
. . . Posted January 10, 2018 Share Posted January 10, 2018 (edited) add this inside YOURCHAR.lua in the master_postinit inst:AddComponent("lootdropper") inst:ListenForEvent("death", Death_Drop_Item) put this above the master_postinit local function Death_Drop_Item(inst) inst.components.lootdropper:SpawnLootPrefab("humanmeat") end it should work Edited January 10, 2018 by SuperDavid Link to comment Share on other sites More sharing options...
CutestGirlHere Posted January 10, 2018 Author Share Posted January 10, 2018 Thank you so much for that. Link to comment 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