Jump to content

LUA programming question


Recommended Posts

wathgrithr has a code I think is helpful but I don't know what it does or what it's doing

local BATTLEBORN_STORE_TIME = 3
local BATTLEBORN_DECAY_TIME = 5
local BATTLEBORN_TRIGGER_THRESHOLD = 1


if inst.battleborn > 0 then
            local dt = GetTime() - inst.battleborn_time - BATTLEBORN_STORE_TIME
            if dt >= BATTLEBORN_DECAY_TIME then
                inst.battleborn = 0
            elseif dt > 0 then
                local k = dt / BATTLEBORN_DECAY_TIME
                inst.battleborn = Lerp(inst.battleborn, 0, k * k)
            end
        end

 

Link to comment
Share on other sites

1 hour ago, Serpens said:

what do oyu mean by "wait command" ?

Do you want something to be done in x seconds from now?
Then use "inst:DoTaskInTime(...)"  (search game/mods code how to properly use it.)

Thank you so much! I tried playing around with the games timers earlier, but I never understood what was the actually time part.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...