Jump to content

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
https://forums.kleientertainment.com/forums/topic/49361-coding-help/
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

@DudedudeThis thread was discussing preventing equipping armor, but I think you could adapt the code to do what you want, too.

 

Thanks for linking me to the thread. I understand everything, but how do I make it unequip a specific item, not all in general?

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
×
  • Create New...