Jump to content

Need help with character mod!


Baddog999

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...