Jump to content

Recommended Posts

I want my character's stats to change when he goes insane, i have tried multiple things (like:

 

if inst.components.sanity.sane==false then

(insert stats here)

else

(insert more stats here)

end

 

This didn't work, when i went insane my stats wouldn't change.

 

I can't figure out how to do this so please help.

you need to add these lines to your characters main function:

 

inst:ListenForEvent("goinsane",OnInsaneFn)

inst:ListenForEvent("gosane",OnSaneFn)

 

Whereas OnInsaneFn and OnSaneFn would have to be declared above and change the stats.

 

local function OnSane(inst)    --statsend--the other fnlocal function fn() --this is already there    local inst = CreateEntity    [...]    inst.ListenForEvent("gosane",OnSane)    --the other one too    return inst --this is already thereend

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