Jump to content

Coding Help


Recommended Posts

Thanks for taking the time to read this, stranger!

My character has a tool.... I want to make it to where he can only use it, and if another character equips itm it unequips itself and the character says, "That's not mine, I can't use it!" or something. I KINDA know how it works, but I don't know how to translate that knowledge into code.

I also want to make it when he eats a crock pot dish, he gains more sanity than a regular character.

Thanks!

Edited by Dudedude
Link to comment
Share on other sites

What does your tool do?

 

Regarding crock pot foods:

local function oneat(eater, food)    eater.components.sanity:DoDelta(food.components.edible:GetSanity(self.inst))end

and then, in "master_postinit(inst)":

inst.components.eater.oneatfn = oneat
Link to comment
Share on other sites

 

What does your tool do?

 

Regarding crock pot foods:

local function oneat(eater, food)    eater.components.sanity:DoDelta(food.components.edible:GetSanity(self.inst))end

and then, in "master_postinit(inst)":

inst.components.eater.oneatfn = oneat

 

My tool is basically a pick/axe, but a little better.

Also, I fail to see how that's crock pot - specific. Could you clarify?

 

Edited by Dudedude
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...