Jump to content

Eat items from your inventory with HUD


Recommended Posts

Hi guys, I am trying to eat items from my RCP hud, I tried using finding items or the eater component, it is for woodie whom who needs idols to transform and it is a bit annoying to look for it always, instead I want to be able to eat it and select each one from the icons on the right of the screen. So far I have dodged this by just outright deleting the item or consuming it, but this warrants more coding and I don't want that.

 

AddModRPCHandler("Woodie_Mod", "goose_button", function(inst)
    if inst:HasTag("goose") then
	    inst.components.wereness:SetPercent(0)
		inst:RemoveTag("goose")
	elseif inst:HasTag("wereplayer") and inst.components.inventory:FindItem(GooseIdol) then
	inst.components.inventory:ConsumeByName("wereitem_goose", 1)
	    inst.components.wereness:SetPercent(0)
		inst:RemoveTag("beaver")
		inst:RemoveTag("moose")
		 inst:AddTag("goose")
	    inst.components.wereness:SetWereMode("goose")
	    inst.components.wereness:SetPercent(1)
	elseif inst.components.inventory:FindItem(GooseIdol) and not inst.components.grogginess.isgroggy and TUNING.WOODIE_CHOPS == 1 then
	    inst.components.inventory:ConsumeByName("wereitem_goose", 1)
	    inst.components.wereness:SetWereMode("goose")
	    inst.components.wereness:SetPercent(1)
	    inst:AddTag("goose")
	elseif inst.components.inventory:FindItem(GooseIdol) and TUNING.WOODIE_CHOPS == 2 then
	    inst.components.inventory:ConsumeByName("wereitem_goose", 1)
	    inst.components.wereness:SetWereMode("goose")
	    inst.components.wereness:SetPercent(1)
	    inst:AddTag("goose")
elseif inst.components.grogginess.isgroggy and TUNING.WOODIE_CHOPS == 1 then
inst.components.talker:Say("I've got chops, buddy.")
	end
end)

on line 189 if you are going to open the modmain text, I have attached, any help, would be appreaciated, thanks...!!

modmain.lua

  • Health 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...