diff --git a/QuickStackToBag/Lua/Autorun/init.lua b/QuickStackToBag/Lua/Autorun/init.lua index 1619496..bdc9ce5 100644 --- a/QuickStackToBag/Lua/Autorun/init.lua +++ b/QuickStackToBag/Lua/Autorun/init.lua @@ -699,3 +699,36 @@ Hook.Patch("Barotrauma.Character", "ControlLocalPlayer", function(instance, ptab end end end, Hook.HookMethodType.After) + +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------------- + +local amountExperience = 600 +local passiveExperienceDelay = 2 +local passiveExperienceTimer = 0 + +Hook.Add("think", "examples.passiveExperience", function() + if Timer.GetTime() < passiveExperienceTimer then return end + + for k, v in pairs(Character.CharacterList) do + if not v.IsDead and v.Info ~= nil then + v.Info.GiveExperience(amountExperience) + end + end + + passiveExperienceTimer = Timer.GetTime() + passiveExperienceDelay +end)