Jump to content

Recommended Posts

I've tried following so many steps on this;

And many other threads on coding the same thing.

It's just that, it never works for me at all, no matter what I do, no matter on how many edits I make that it's supposed to "help" according to these threads.

I even tried Wigfrid's battleborn code, yet it still doesn't work.

I'm not a scripter at all though, I just need help just this once to make this character function without it crashing my game.

If you can help, thank you I would really appreciate it.

4 hours ago, Arkathorn said:

This should work (Put it in your character's prefab file.):


inst:ListenForEvent("killed",function(inst,data)
	inst.components.sanity:DoDelta(15) --Restores 15 sanity
end)

I have tried the code, it didn't work, it gave me this error:

https://gyazo.com/ac8b8a7942fc88c34288fb3253298cbb

Do you have to put it as a local function to define it like the rest of the inst strings?

15 minutes ago, Nerune said:

I have tried the code, it didn't work, it gave me this error:

Do you have to put it as a local function to define it like the rest of the inst strings?

No, you put it into the postinit function.
 

inst.soundname = "winnie"

--your code here

inst.components.health:SetBlabla(150)

 

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...