• Help with DarkRP hunger mod entities
    3 replies, posted
Hey guys I have hit a road block involving hunger mod. I have custom food downloaded from workshop and its in the q menu but only heals hp and not hunger. No problem there, so I used the food.lua file in darkrpmodification to create a food item. DarkRP.createFood("Mac&Cheese", { model = "food_macncheese", energy = 10, price = 10, allowed = {TEAM_GUN}, }) So now my food is created. However I dont want players to spawn in the food (I don't have a team gun job so no one can spawn them in from f4) I want to use a vending machine addon to spawn the food that heals hunger. In this addon I have these fields: VendingMachines.AddItem { Name = "SMG", Price = 60, Description = "100 SMG ammo.", Entity = "m9k_ammo_smg" } The issue is that I have the name of the entity of food from the qmenu: food_macncheese But this will not spawn the food that heals hunger and only the original that heals HP. How can I find the entity name that is created using food.lua? Thanks for any help.
Anyone have any clue how to achieve this?
Use lua to make the food_macncheese spawned by the vending machine to do it. Tou have two ways, 1. Edit the food_macncheese - the entity file it self, and on use make it give you what u want. 2. When the vending machine spawn food give it a Entity.Food var with the number u want to feed the player, and then use hook PlayerUse to check if the entity has the var, if it does use the darkrp function to feed the player. Note: option 1 is much more optimised
Okay I found where to add the code to the entity. What code would I use to make the food heal hunger?
Sorry, you need to Log In to post a reply to this thread.