SomeoneStrange Posted October 20, 2017 Share Posted October 20, 2017 Quick question, is there a wait command to use while making a DST character? I am making a battle mode for a character and I am having trouble setting a timer for the battle mode. Any ideas? Link to comment https://forums.kleientertainment.com/forums/topic/83133-lua-programming-question/ Share on other sites More sharing options...
SomeoneStrange Posted October 20, 2017 Author Share Posted October 20, 2017 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 https://forums.kleientertainment.com/forums/topic/83133-lua-programming-question/#findComment-965116 Share on other sites More sharing options...
Serpens Posted October 21, 2017 Share Posted October 21, 2017 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.) Link to comment https://forums.kleientertainment.com/forums/topic/83133-lua-programming-question/#findComment-965293 Share on other sites More sharing options...
monkeybee Posted October 21, 2017 Share Posted October 21, 2017 hang on by wait do u mean wait 4 sec then do this ? if so its sleep() Link to comment https://forums.kleientertainment.com/forums/topic/83133-lua-programming-question/#findComment-965299 Share on other sites More sharing options...
SomeoneStrange Posted October 21, 2017 Author Share Posted October 21, 2017 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 https://forums.kleientertainment.com/forums/topic/83133-lua-programming-question/#findComment-965310 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