Search the Community
Showing results for tags 'counter'.
Hello, It's always these easy things that I struggle with. So what I'm looking to do is to create a counter. While the player is moving the counter will increase by 1 each second. Once the counter has reached 800, perform a function. If the player is not moving, the counter will not increase. I think the main issue I'm running into is figuring out how to pass the count variable into the counter. Example local function counter(inst) if inst.sg:HasStateTag("moving") then count = count + 1 end end local master_postinit = function(inst) local count = 0 return inst end Any help out would be appreciated. Thanks, Nathan