Jump to content
bassair

Can't make my "chronic fatigue" trait, well, fatigue

Recommended Posts

So, what I have is... 

require('NPCs/MainCreationMethods');local function initPersonalTraits()	local chronicfatigue = TraitFactory.addTrait("ChronicFatigue", getText("UI_trait_ChronicFatigue"), -5, getText("UI_trait_ChronicFatiguedesc"), false, false);		endPersonalTraits.EveryTenMinutes = function()	if getSpecificPlayer(0):HasTrait("ChronicFatigue") then		getSpecificPlayer(0):getStats():setFatigue(getSpecificPlayer(0):getStats():getFatigue()-0.015);        else            		getSpecificPlayer(0):getStats():setFatigue(getSpecificPlayer(0):getStats():getFatigue()+0.015);	end	end	PersonalTraits.OnGameStart = function()endEvents.OnGameBoot.Add(initPersonalTraits);Events.EveryTenMinutes.Add(PersonalTraits.EveryTenMinutes);Events.OnPlayerUpdate.Add(PersonalTraits.OnPlayerUpdate);Events.OnGameStart.Add(PersonalTraits.OnGameStart);

but it doesn't.

 

If I take

PersonalTraits.EveryTenMinutes = function()	if getSpecificPlayer(0):HasTrait("ChronicFatigue") then		getSpecificPlayer(0):getStats():setFatigue(getSpecificPlayer(0):getStats():getFatigue()-0.015);        else            		getSpecificPlayer(0):getStats():setFatigue(getSpecificPlayer(0):getStats():getFatigue()+0.015);	end	end	PersonalTraits.OnGameStart = function()end

out the trait will show up! But what I want it to do is make you get hella tired and need to sleep/rest a lot. 

 

What am I doing wrong? D:

 

(Also I tried it without the else first. I want it to JUST make you tired until you rest, really, but I was just... trying to make it work o-o)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...