function onUse(use) if count == 9 then count = 0 else count = count + 1 end SetCounterOffset(count) end function SetCounterOffset(count) local offset = Vector2.zero -- y shift local Yshift = math.floor(count / 4) offset.y = -0.25 * Yshift -- x shift local Xshift = count % 4 offset.x = 0.25 * Xshift vci.assets.material.SetTextureOffsetFromIndex(1, offset) end