Jump to content

How can i eat nightmarefuel


Recommended Posts

I was able to eat nightmare fuel but

My friend could not eat the nightmare fuel.
How should I fix it?
Help


Codes

--PUT THE CODE BELOW IN MODMAIN.LUA

local FOODTYPE = GLOBAL.FOODTYPE
FOODTYPE.SHADOW = "SHADOW"

AddComponentPostInit("eater", function(self)
	function self:SetCanEatShadows()
		table.insert(self.preferseating, FOODTYPE.SHADOW)
		table.insert(self.caneat, FOODTYPE.SHADOW)
		self.inst:AddTag(FOODTYPE.SHADOW.."_eater")
	end
end)

AddPrefabPostInit("nightmarefuel", function(inst)
	if not GLOBAL.TheWorld.ismastersim then
		return inst
	end
	inst:AddComponent("edible")
	inst.components.edible.foodtype = FOODTYPE.SHADOW
	inst.components.edible.healthvalue = 5--CHANGE THESE 3 VALUES TO ANYTHING YOU WANT
	inst.components.edible.hungervalue = 10
	inst.components.edible.sanityvalue = 15
end)

--PUT THE CODE BELOW IN YOUR CHARACTER.LUA (in master_postinit)

inst.components.eater:SetCanEatShadows()
Edited by JoeW
formatting
Link to comment
Share on other sites

If it's not the same character, it's not going to work because your friends's character will not be a "nightmare fuel eater". Just yours, because your character does have this line in its character.lua file:

inst.components.eater:SetCanEatShadows()
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...