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 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 Share on other sites More sharing options...
Recommended Posts
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.