DaniloSuzuki Posted October 31, 2019 Share Posted October 31, 2019 Guys i'm trying to do a perk to my character that he will regen HP during Night (Testing as Day) but call GetClock() crashes my game, anyone can help me with that?? inst:AddTag("notactive") local function CheckTime(inst) if GetClock() and GetWorld() then if not GetClock():IsDay() and inst:HasTag("active") and not GetWorld():IsCave() then inst.components.health:StopRegen() inst:AddTag("notactive") inst:RemoveTag("active") end if GetClock():IsDay() and inst:HasTag("notactive") and not GetWorld():IsCave() then components.health:StartRegen(1,5,true) inst:AddTag("active") inst:RemoveTag("notactive") end end end inst:DoPeriodicTask( 0.0, function(inst) CheckTime(inst) end) Link to comment https://forums.kleientertainment.com/forums/topic/113216-first-mod-character-problem-with-getclock-and-getworld/ Share on other sites More sharing options...
DaniloSuzuki Posted October 31, 2019 Author Share Posted October 31, 2019 Found the Solution! GetClock() and GetWorld -> TheWorld.stage and TheWorld Link to comment https://forums.kleientertainment.com/forums/topic/113216-first-mod-character-problem-with-getclock-and-getworld/#findComment-1279299 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now